forked from ungleich-public/cdist
		
	enable running scripts/cdist directly and symlinked
This commit is contained in:
		
					parent
					
						
							
								45d51c0e15
							
						
					
				
			
			
				commit
				
					
						3f1939716f
					
				
			
		
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -22,7 +22,15 @@
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
import sys
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cdist_bin = os.path.abspath(__file__)
 | 
				
			||||||
 | 
					if os.path.islink(cdist_bin):
 | 
				
			||||||
 | 
					    cdist_bin = os.readlink(cdist_bin)
 | 
				
			||||||
 | 
					cdist_dir = os.path.abspath(os.path.join(os.path.dirname(cdist_bin), os.pardir))
 | 
				
			||||||
 | 
					sys.path.insert(0, cdist_dir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import cdist
 | 
					import cdist
 | 
				
			||||||
import cdist.argparse
 | 
					import cdist.argparse
 | 
				
			||||||
import cdist.banner
 | 
					import cdist.banner
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue