Provide an exit code when raising SystemExit.
This will make it easier for scripts which call OpenStack tools to detect failure if SystemExit isn't caught by the calling code. Change-Id: Ic829b704d1629fcb0d926118367af122c25b7fba
This commit is contained in:
parent
bc7cc773d1
commit
033eb03b52
@ -2990,7 +2990,7 @@ class ConfigOpts(abc.Mapping):
|
||||
except ValueError:
|
||||
sys.stderr.write("argument --%s: Invalid %s value: %s\n" % (
|
||||
opt.dest, repr(opt.type), value))
|
||||
raise SystemExit
|
||||
raise SystemExit(1)
|
||||
|
||||
def _reload_config_files(self):
|
||||
namespace = self._parse_config_files()
|
||||
|
@ -826,7 +826,7 @@ def main(args=None):
|
||||
except cfg.RequiredOptError:
|
||||
conf.print_help()
|
||||
if not sys.argv[1:]:
|
||||
raise SystemExit
|
||||
raise SystemExit(1)
|
||||
raise
|
||||
generate(conf)
|
||||
|
||||
|
@ -227,7 +227,7 @@ def main():
|
||||
except cfg.RequiredOptError:
|
||||
conf.print_help()
|
||||
if not sys.argv[1:]:
|
||||
raise SystemExit
|
||||
raise SystemExit(1)
|
||||
raise
|
||||
return _validate(conf)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user