Skip to content

Commit

Permalink
Add --enablerepo option for (pre)upgrade commands
Browse files Browse the repository at this point in the history
The option is used to enable repository (based on given repoid) for
the IPU. Can be used multiple times.
  • Loading branch information
pirat89 committed Apr 16, 2020
1 parent 64cc330 commit cb4091c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions leapp/cli/upgrade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ def prepare_configuration(args):
os.environ['LEAPP_NO_RHSM'] = '1'
elif os.getenv('LEAPP_NO_RHSM') != '1':
os.environ['LEAPP_NO_RHSM'] = os.getenv('LEAPP_DEVEL_SKIP_RHSM', '0')
if args.enablerepo:
os.environ['LEAPP_ENABLE_REPOS'] = ','.join(args.enablerepo)
configuration = {
'debug': os.getenv('LEAPP_DEBUG', '0'),
'verbose': os.getenv('LEAPP_VERBOSE', '0'),
Expand All @@ -181,14 +183,16 @@ def process_whitelist_experimental(repositories, workflow, configuration, logger
raise CommandError(msg)


@command('upgrade', help='Upgrades the current system to the next available major version.')
@command('upgrade', help='Upgrade the current system to the next available major version.')
@command_opt('resume', is_flag=True, help='Continue the last execution after it was stopped (e.g. after reboot)')
@command_opt('reboot', is_flag=True, help='Automatically performs reboot when requested.')
@command_opt('whitelist-experimental', action='append', metavar='ActorName', help='Enables experimental actors')
@command_opt('whitelist-experimental', action='append', metavar='ActorName', help='Enable experimental actors')
@command_opt('debug', is_flag=True, help='Enable debug mode', inherit=False)
@command_opt('verbose', is_flag=True, help='Enable verbose logging', inherit=False)
@command_opt('no-rhsm', is_flag=True, help='Use only custom repositories and skip actions'
' with Red Hat Subscription Manager')
@command_opt('enablerepo', action='append', metavar='<repoid>',
help='Enable specified repository. Can be used multiple times.')
def upgrade(args):
skip_phases_until = None
context = str(uuid.uuid4())
Expand Down Expand Up @@ -253,6 +257,8 @@ def upgrade(args):
@command_opt('verbose', is_flag=True, help='Enable verbose logging', inherit=False)
@command_opt('no-rhsm', is_flag=True, help='Use only custom repositories and skip actions'
' with Red Hat Subscription Manager')
@command_opt('enablerepo', action='append', metavar='<repoid>',
help='Enable specified repository. Can be used multiple times.')
def preupgrade(args):
context = str(uuid.uuid4())
cfg = get_config()
Expand Down

0 comments on commit cb4091c

Please sign in to comment.