Browse Source

Fix stream arg validation

Now that args.stream is always true, the validation must take into
account whether args.no_stream is set. Without this validation will
always fail on non-stream distros.

Change-Id: I2d1f2f6d72e8ebbec69885faf825f0aee8afbbfc
changes/87/786987/1
Steve Baker 4 weeks ago
parent
commit
f25e26cba0
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      tripleo_repos/main.py

+ 3
- 2
tripleo_repos/main.py View File

@ -295,10 +295,11 @@ def _validate_distro_stream(args, distro_name):
Fails if stream is to be used but the host isn't a stream OS or vice versa
"""
if args.stream and 'stream' not in distro_name.lower():
is_stream = args.stream and not args.no_stream
if is_stream and 'stream' not in distro_name.lower():
raise InvalidArguments('--stream provided, but OS is not the Stream '
'version. Please ensure the host is Stream.')
elif args.no_stream and 'stream' in distro_name.lower():
elif not is_stream and 'stream' in distro_name.lower():
raise InvalidArguments('--no-stream provided, but OS is the Stream '
'version. Please ensure the host is not the '
'Stream version.')


Loading…
Cancel
Save