Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Fixes #6927 - move checks on pulp capsule preconditions to pre_validate hook #96

Merged
merged 1 commit into from
Aug 13, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions hooks/pre_validations/10-check_capsule_pulp.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def error(message)
say message
logger.error message
kafo.class.exit 101
end

if param('capsule', 'pulp') && param('capsule', 'pulp').value
if system("rpm -q katello &>/dev/null")
error "the pulp node can't be installed on a machine with Katello master"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the actual issue that arises if this is attempted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are steps leading towards setting the pulp as a node, so quite possibly break the Foretello as a consequence. Not that this particular rpm would be the issue, but we need some mechanism to prevent setting the pulp node on the sat6

end

if system("(rpm -q ipa-server || rpm -q freeipa-server) &>/dev/null")
error "the pulp node can't be installed on a machine with IPA"
end

unless system("subscription-manager identity | grep identity && ! grep -q subscription.rhn.redhat.com /etc/rhsm/rhsm.conf")
error "The system has to be registered to a Katello instance before installing the node"
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want todo:

unless system("subscription-manager identity | grep identity && ! grep -q subscription.rhn.redhat.com /etc/rhsm/rhsm.conf")

this will ensure that it is registered to the Satellite and not the Customer Portal

ACK otherwise

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, updated

end