Commit f0a80b01 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

watcher: Fix misleading usage output



When “ganeti-watcher” is called with an argument, it would hint at
a non-existing “-f” parameter. With this patch the separate usage
string is no longer necessary.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent e4e35357
......@@ -692,14 +692,18 @@ def ParseOptions():
constants.RELEASE_VERSION)
parser.add_option(cli.DEBUG_OPT)
parser.add_option("-A", "--job-age", dest="job_age",
parser.add_option("-A", "--job-age", dest="job_age", default=6 * 3600,
help="Autoarchive jobs older than this age (default"
" 6 hours)", default=6*3600)
" 6 hours)")
parser.add_option("--ignore-pause", dest="ignore_pause", default=False,
action="store_true", help="Ignore cluster pause setting")
options, args = parser.parse_args()
options.job_age = cli.ParseTimespec(options.job_age)
return options, args
if args:
parser.error("No arguments expected")
return (options, args)
@rapi.client.UsesRapiClient
......@@ -709,11 +713,7 @@ def Main():
"""
global client # pylint: disable-msg=W0603
options, args = ParseOptions()
if args: # watcher doesn't take any arguments
print >> sys.stderr, ("Usage: %s [-f] " % sys.argv[0])
return constants.EXIT_FAILURE
(options, _) = ParseOptions()
utils.SetupLogging(constants.LOG_WATCHER, sys.argv[0],
debug=options.debug, stderr_logging=options.debug)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment