Skip to content
Snippets Groups Projects
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
No related merge requests found
...@@ -692,14 +692,18 @@ def ParseOptions(): ...@@ -692,14 +692,18 @@ def ParseOptions():
constants.RELEASE_VERSION) constants.RELEASE_VERSION)
parser.add_option(cli.DEBUG_OPT) 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" 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, parser.add_option("--ignore-pause", dest="ignore_pause", default=False,
action="store_true", help="Ignore cluster pause setting") action="store_true", help="Ignore cluster pause setting")
options, args = parser.parse_args() options, args = parser.parse_args()
options.job_age = cli.ParseTimespec(options.job_age) options.job_age = cli.ParseTimespec(options.job_age)
return options, args
if args:
parser.error("No arguments expected")
return (options, args)
@rapi.client.UsesRapiClient @rapi.client.UsesRapiClient
...@@ -709,11 +713,7 @@ def Main(): ...@@ -709,11 +713,7 @@ def Main():
""" """
global client # pylint: disable-msg=W0603 global client # pylint: disable-msg=W0603
options, args = ParseOptions() (options, _) = ParseOptions()
if args: # watcher doesn't take any arguments
print >> sys.stderr, ("Usage: %s [-f] " % sys.argv[0])
return constants.EXIT_FAILURE
utils.SetupLogging(constants.LOG_WATCHER, sys.argv[0], utils.SetupLogging(constants.LOG_WATCHER, sys.argv[0],
debug=options.debug, stderr_logging=options.debug) debug=options.debug, stderr_logging=options.debug)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment