From 7c566309246bba675f17f82378cd596f53ecd5cc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 16 Sep 2011 13:13:56 +0200 Subject: [PATCH] prepare installation routine Signed-off-by: Nico Schottelius --- bin/cdist | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/bin/cdist b/bin/cdist index f7ad2f72..49985c01 100755 --- a/bin/cdist +++ b/bin/cdist @@ -604,6 +604,10 @@ def banner(args): print(BANNER) sys.exit(0) +def install(args): + """Install remote system""" + process = {} + def config(args): """Configure remote system""" process = {} @@ -648,25 +652,33 @@ if __name__ == "__main__": add_help=False) parser['banner'].set_defaults(func=banner) - # Config - parser['config'] = parser['sub'].add_parser('config', - parents=[parser['most']]) - parser['config'].add_argument('host', nargs='+', + # Config and install (common stuff) + parser['configinstall'] = argparse.ArgumentParser(add_help=False) + parser['configinstall'].add_argument('host', nargs='+', help='one or more hosts to operate on') - parser['config'].add_argument('-c', '--cdist-home', + parser['configinstall'].add_argument('-c', '--cdist-home', help='Change cdist home (default: .. from bin directory)', action='store') - parser['config'].add_argument('-i', '--initial-manifest', + parser['configinstall'].add_argument('-i', '--initial-manifest', help='Path to a cdist manifest', dest='manifest', required=False) - parser['config'].add_argument('-p', '--parallel', + parser['configinstall'].add_argument('-p', '--parallel', help='Operate on multiple hosts in parallel', action='store_true', dest='parallel') - parser['config'].add_argument('-s', '--sequential', + parser['configinstall'].add_argument('-s', '--sequential', help='Operate on multiple hosts sequentially (default)', action='store_false', dest='parallel') + + # Config + parser['config'] = parser['sub'].add_parser('config', + parents=[parser['most'], parser['configinstall']]) parser['config'].set_defaults(func=config) + # Install + parser['install'] = parser['sub'].add_parser('install', + parents=[parser['most'], parser['configinstall']]) + parser['install'].set_defaults(func=install) + for p in parser: parser[p].epilog = "Get cdist at http://www.nico.schottelius.org/software/cdist/"