add default values in argparse
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								c7fbdc8195
							
						
					
				
			
			
				commit
				
					
						108283bbeb
					
				
			
		
					 1 changed files with 9 additions and 4 deletions
				
			
		
							
								
								
									
										13
									
								
								bin/cdist
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								bin/cdist
									
										
									
									
									
								
							| 
						 | 
					@ -68,12 +68,15 @@ def commandline():
 | 
				
			||||||
    parser['configinstall'].add_argument('-s', '--sequential',
 | 
					    parser['configinstall'].add_argument('-s', '--sequential',
 | 
				
			||||||
         help='Operate on multiple hosts sequentially (default)',
 | 
					         help='Operate on multiple hosts sequentially (default)',
 | 
				
			||||||
         action='store_false', dest='parallel')
 | 
					         action='store_false', dest='parallel')
 | 
				
			||||||
    parser['configinstall'].add_argument('--remote-exec',
 | 
					
 | 
				
			||||||
         help='Command to use for remote execution (should behave like ssh)',
 | 
					 | 
				
			||||||
         action='store_true', dest='remote_exec')
 | 
					 | 
				
			||||||
    parser['configinstall'].add_argument('--remote-copy',
 | 
					    parser['configinstall'].add_argument('--remote-copy',
 | 
				
			||||||
         help='Command to use for remote copy (should behave like scp)',
 | 
					         help='Command to use for remote copy (should behave like scp)',
 | 
				
			||||||
         action='store_true', dest='remote_copy')
 | 
					         action='store', dest='remote_copy',
 | 
				
			||||||
 | 
					         default="scp -o User=root -q")
 | 
				
			||||||
 | 
					    parser['configinstall'].add_argument('--remote-exec',
 | 
				
			||||||
 | 
					         help='Command to use for remote execution (should behave like ssh)',
 | 
				
			||||||
 | 
					         action='store', dest='remote_exec',
 | 
				
			||||||
 | 
					         default="ssh -o User=root -q")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Config
 | 
					    # Config
 | 
				
			||||||
    parser['config'] = parser['sub'].add_parser('config',
 | 
					    parser['config'] = parser['sub'].add_parser('config',
 | 
				
			||||||
| 
						 | 
					@ -165,6 +168,8 @@ def configinstall_onehost(host, args, mode, parallel):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        context = cdist.context.Context(
 | 
					        context = cdist.context.Context(
 | 
				
			||||||
            target_host=host,
 | 
					            target_host=host,
 | 
				
			||||||
 | 
					            remote_copy=args.remote_copy,
 | 
				
			||||||
 | 
					            remote_exec=args.remote_exec,
 | 
				
			||||||
            initial_manifest=args.manifest,
 | 
					            initial_manifest=args.manifest,
 | 
				
			||||||
            base_path=args.cdist_home,
 | 
					            base_path=args.cdist_home,
 | 
				
			||||||
            exec_path=sys.argv[0],
 | 
					            exec_path=sys.argv[0],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue