upd utils
This commit is contained in:
parent
5dd15cf01d
commit
3ac1cf5404
@ -8,7 +8,7 @@ Usage: na-vmctl [options] status <machine>
|
||||
|
||||
Options:
|
||||
-c, --config <file> Config file [default: /etc/node-agent/config.yaml]
|
||||
-l, --loglvl <lvl> Logging level [default: INFO]
|
||||
-l, --loglvl <lvl> Logging level
|
||||
-f, --force Force action. On shutdown calls graceful destroy()
|
||||
-9, --sigkill Send SIGKILL to QEMU process. Not affects without --force
|
||||
"""
|
||||
@ -39,9 +39,12 @@ class Color:
|
||||
def cli():
|
||||
args = docopt(__doc__)
|
||||
config = pathlib.Path(args['--config']) or None
|
||||
loglvl = args['--loglvl'].upper()
|
||||
loglvl = None
|
||||
machine = args['<machine>']
|
||||
|
||||
if args['--loglvl']:
|
||||
loglvl = args['--loglvl'].upper()
|
||||
|
||||
if loglvl in levels:
|
||||
logging.basicConfig(level=levels[loglvl])
|
||||
|
||||
|
@ -5,7 +5,7 @@ Usage: na-vmexec [options] <machine> <command>
|
||||
|
||||
Options:
|
||||
-c, --config <file> Config file [default: /etc/node-agent/config.yaml]
|
||||
-l, --loglvl <lvl> Logging level [default: INFO]
|
||||
-l, --loglvl <lvl> Logging level
|
||||
-s, --shell <shell> Guest shell [default: /bin/sh]
|
||||
-t, --timeout <sec> QEMU timeout in seconds to stop polling command status [default: 60]
|
||||
"""
|
||||
@ -35,9 +35,12 @@ class Color:
|
||||
def cli():
|
||||
args = docopt(__doc__)
|
||||
config = pathlib.Path(args['--config']) or None
|
||||
loglvl = args['--loglvl'].upper()
|
||||
loglvl = None
|
||||
machine = args['<machine>']
|
||||
|
||||
if args['--loglvl']:
|
||||
loglvl = args['--loglvl'].upper()
|
||||
|
||||
if loglvl in levels:
|
||||
logging.basicConfig(level=levels[loglvl])
|
||||
|
||||
@ -91,6 +94,7 @@ def cli():
|
||||
print(Color.RED + stderr.strip() + Color.NONE, file=sys.stderr)
|
||||
if stdout:
|
||||
print(Color.GREEN + stdout.strip() + Color.NONE, file=sys.stdout)
|
||||
sys.exit(exitcode)
|
||||
|
||||
if __name__ == '__main__':
|
||||
cli()
|
||||
|
Loading…
Reference in New Issue
Block a user