Merge "Ensure options passed to update.py are sane"

This commit is contained in:
Jenkins 2014-06-16 19:34:43 +00:00 committed by Gerrit Code Review
commit 45890dae35
1 changed files with 8 additions and 1 deletions

View File

@ -125,7 +125,14 @@ def _parse_args(argv):
config_file = def_config_file(conf.configfile_or_destdir)
if config_file:
conf(argv + ['--config-file', config_file])
if not (conf.module or conf.modules):
conf(argv + ['--config-file', config_file])
elif os.path.isdir(conf.configfile_or_destdir):
conf(argv + ['--dest-dir', conf.configfile_or_destdir])
else:
print('Specifying a config file and a list of modules to '
'sync will not work correctly', file=sys.stderr)
sys.exit(1)
return conf