From 7e8362eeedd24f7df7c983d4e698dfdccb162f76 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 8 Sep 2011 22:44:25 +0200 Subject: [PATCH] allow zero hosts to be specified, fixup exit_error Signed-off-by: Nico Schottelius --- bin/cdist | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/cdist b/bin/cdist index ad87b38c..8f556b1e 100755 --- a/bin/cdist +++ b/bin/cdist @@ -160,7 +160,7 @@ class Cdist: try: subprocess.check_call(*args, **kargs) except subprocess.CalledProcessError: - self.exit_error("Command failed:", " ".join(*args)) + self.exit_error("Command failed: " + " ".join(*args)) def remote_run_or_fail(self, *args, **kargs): """Run something on the remote side and fail is something breaks""" @@ -349,20 +349,20 @@ class Cdist: if __name__ == "__main__": parser = argparse.ArgumentParser(description='cdist ' + VERSION) - parser.add_argument('host', nargs='+', help='one or more hosts to operate on') + parser.add_argument('host', nargs='*', help='one or more hosts to operate on') parser.add_argument('-b', '--banner', help='Show cdist banner', action='store_true', dest='banner') - parser.add_argument('-d', '--debug', help='set log level to debug', + parser.add_argument('-d', '--debug', help='Set log level to debug', action='store_true') parser.add_argument('-i', '--initial-manifest', - help='path to a cdist manifest or - to read from stdin', + help='Path to a cdist manifest or - to read from stdin', dest='manifest', required=False) parser.add_argument('-p', '--parallel', - help='operate on multiple hosts in parallel', + help='Operate on multiple hosts in parallel', action='store_true', dest='parallel') parser.add_argument('-s', '--sequential', - help='operate on multiple hosts sequentially', + help='Operate on multiple hosts sequentially', action='store_false', dest='parallel') args = parser.parse_args(sys.argv[1:])