Verify that machine-config arg is a file
If machine-config is pointed to a non-existant file, dryrun can kind of unhelpfully hang without much indication that anything is happening.
This commit is contained in:
parent
9f883ff0f7
commit
ada889328d
|
@ -44,6 +44,7 @@ def parse_options(argv):
|
|||
help='Run the installer in ascii mode.')
|
||||
parser.add_argument('--machine-config', metavar='CONFIG',
|
||||
dest='machine_config',
|
||||
type=argparse.FileType(),
|
||||
help="Don't Probe. Use probe data file")
|
||||
parser.add_argument('--screens', action='append', dest='screens',
|
||||
default=[])
|
||||
|
|
|
@ -36,6 +36,7 @@ def make_server_args_parser():
|
|||
parser.add_argument('--socket')
|
||||
parser.add_argument('--machine-config', metavar='CONFIG',
|
||||
dest='machine_config',
|
||||
type=argparse.FileType(),
|
||||
help="Don't Probe. Use probe data file")
|
||||
parser.add_argument('--bootloader',
|
||||
choices=['none', 'bios', 'prep', 'uefi'],
|
||||
|
|
|
@ -29,8 +29,7 @@ class Prober():
|
|||
def __init__(self, machine_config, debug_flags):
|
||||
self.saved_config = None
|
||||
if machine_config:
|
||||
with open(machine_config) as mc:
|
||||
self.saved_config = yaml.safe_load(mc)
|
||||
self.saved_config = yaml.safe_load(machine_config)
|
||||
self.debug_flags = debug_flags
|
||||
log.debug('Prober() init finished, data:{}'.format(self.saved_config))
|
||||
|
||||
|
|
Loading…
Reference in New Issue