forked from ungleich-public/cdist
		
	also move out install and cleanup library path code
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								35e33570d1
							
						
					
				
			
			
				commit
				
					
						27b4b9cd03
					
				
			
		
					 2 changed files with 36 additions and 10 deletions
				
			
		
							
								
								
									
										16
									
								
								bin/cdist
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								bin/cdist
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -33,17 +33,13 @@ import sys
 | 
			
		|||
import tempfile
 | 
			
		||||
 | 
			
		||||
log = logging.getLogger(__name__)
 | 
			
		||||
real_me = os.path.dirname(os.path.realpath(__file__))
 | 
			
		||||
cdist_lib = os.path.abspath(os.path.join(real_me, '../lib'))
 | 
			
		||||
 | 
			
		||||
sys.path.insert(0, cdist_lib)
 | 
			
		||||
# Ensure our /lib/ is included into PYTHON_PATH
 | 
			
		||||
sys.path.insert(0, os.path.abspath(
 | 
			
		||||
        os.path.join(os.path.dirname(os.path.realpath(__file__)), '../lib'))
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
TYPE_PREFIX = "__"
 | 
			
		||||
CODE_HEADER                     = "#!/bin/sh -e\n"
 | 
			
		||||
 | 
			
		||||
def install(args):
 | 
			
		||||
    """Install remote system"""
 | 
			
		||||
    process = {}
 | 
			
		||||
 | 
			
		||||
def commandline():
 | 
			
		||||
    """Parse command line"""
 | 
			
		||||
| 
						 | 
				
			
			@ -91,7 +87,7 @@ def commandline():
 | 
			
		|||
    # Install
 | 
			
		||||
    parser['install'] = parser['sub'].add_parser('install',
 | 
			
		||||
        parents=[parser['most'], parser['configinstall']])
 | 
			
		||||
    parser['install'].set_defaults(func=install)
 | 
			
		||||
    parser['install'].set_defaults(func=cdist.install.install)
 | 
			
		||||
 | 
			
		||||
    for p in parser:
 | 
			
		||||
        parser[p].epilog = "Get cdist at http://www.nico.schottelius.org/software/cdist/"
 | 
			
		||||
| 
						 | 
				
			
			@ -106,7 +102,6 @@ def commandline():
 | 
			
		|||
 | 
			
		||||
    args.func(args)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    try:
 | 
			
		||||
        logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
 | 
			
		||||
| 
						 | 
				
			
			@ -119,6 +114,7 @@ if __name__ == "__main__":
 | 
			
		|||
            import cdist.banner
 | 
			
		||||
            import cdist.config
 | 
			
		||||
            import cdist.exec
 | 
			
		||||
            import cdist.install
 | 
			
		||||
            import cdist.path
 | 
			
		||||
 | 
			
		||||
            commandline()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue