Skip to content

Commit

Permalink
Merge pull request #151 from elyezer/improve-subscribe-task
Browse files Browse the repository at this point in the history
Subscribe to <major>Server release
  • Loading branch information
omaciel committed Feb 24, 2015
2 parents ebe5c4f + 76d9074 commit 58d037d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions automation_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def subscribe(autosubscribe=False):

# Registration and subscription is only meaningful for Red Hat Enterprise
# Linux systems.
distro, major_version, minor_version = distro_info()
distro, major_version, _ = distro_info()
if distro.lower() != 'rhel':
return

Expand All @@ -56,18 +56,13 @@ def subscribe(autosubscribe=False):
if env_var not in os.environ:
print('The {0} environment variable must be set.'.format(env_var))
sys.exit(1)
if minor_version is None:
minor_version = 'Server'
else:
minor_version = '.{0}'.format(minor_version)
run(
'subscription-manager register --force --user={0} --password={1} '
'--release="{2}{3}" {4}'
'--release="{2}Server" {3}'
.format(
os.environ['RHN_USERNAME'],
os.environ['RHN_PASSWORD'],
major_version,
minor_version,
'--autosubscribe' if autosubscribe else ''
)
)
Expand Down

0 comments on commit 58d037d

Please sign in to comment.