Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix partition table help #115

Merged
merged 3 commits into from
Oct 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_architecture():
parser.add_option("-g", "--hostgroup", dest="hostgroup", help="Title of the Hostgroup in Foreman that the host is to be associated with", metavar="HOSTGROUP")
parser.add_option("-L", "--location", dest="location", help="Title of the Location in Foreman that the host is to be associated with", metavar="LOCATION")
parser.add_option("-O", "--operatingsystem", dest="operatingsystem", default=None, help="Title of the Operating System in Foreman that the host is to be associated with", metavar="OPERATINGSYSTEM")
parser.add_option("--partitiontable", dest="partitiontable", default=None, help="Name of the Operating System in Foreman that the host is to be associated with", metavar="PARTITIONTABLE")
parser.add_option("--partitiontable", dest="partitiontable", default=None, help="Name of the Partition Table in Foreman that the host is to be associated with", metavar="PARTITIONTABLE")
parser.add_option("-o", "--organization", dest="org", default='Default_Organization', help="Name of the Organization in Foreman that the host is to be associated with", metavar="ORG")
parser.add_option("-S", "--subscription-manager-args", dest="smargs", default="", help="Which additional arguments shall be passed to subscription-manager", metavar="ARGS")
parser.add_option("--rhn-migrate-args", dest="rhsmargs", default="", help="Which additional arguments shall be passed to rhn-migrate-classic-to-rhsm", metavar="ARGS")
Expand All @@ -83,6 +83,7 @@ def get_architecture():
parser.add_option("--unmanaged", dest="unmanaged", action="store_true", help="Add the server as unmanaged. Useful to skip provisioning dependencies.")
parser.add_option("--rex", dest="remote_exec", action="store_true", help="Install Foreman's SSH key for remote execution.", default=False)
parser.add_option("--rex-user", dest="remote_exec_user", default="root", help="Local user used by Foreman's remote execution feature.")
parser.add_option("--enablerepos", dest="enablerepos", help="Repositories to be enabled via subscription-manager - comma separated", metavar="enablerepos")
(options, args) = parser.parse_args()

if not (options.foreman_fqdn and options.login and (options.remove or (options.org and options.activationkey and (options.no_foreman or options.hostgroup)))):
Expand Down Expand Up @@ -503,6 +504,10 @@ def check_rhn_registration():
else:
return False

def enable_repos():
repostoenable = " ".join(['--enable=%s' % i for i in options.enablerepos.split(',')])
print_running("Enabling repositories - %s" % option.enablerepos)
exec_failok("subscription-manager repos %s" % repostoenable)

def get_api_port():
configparser = SafeConfigParser()
Expand Down Expand Up @@ -602,13 +607,17 @@ class MEOptions:
if not options.no_foreman:
create_host()
migrate_systems(options.org, options.activationkey)
if options.enablerepos:
enable_repos()
else:
print_generic('This system is not registered to RHN. Attempting to register via subscription-manager')
get_bootstrap_rpm()
API_PORT = get_api_port()
if not options.no_foreman:
create_host()
register_systems(options.org, options.activationkey, options.release)
if options.enablerepos:
enable_repos()

if not options.remove:
install_katello_agent()
Expand Down