mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			907 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			907 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/python
 | 
						|
from cloudutils.syscfg import sysConfigFactory
 | 
						|
from cloudutils.utilities import initLoging
 | 
						|
from cloudutils.cloudException import CloudRuntimeException, CloudInternalException
 | 
						|
from cloudutils.globalEnv import globalEnv
 | 
						|
from cloudutils.serviceConfigServer import cloudManagementConfig
 | 
						|
if __name__ == '__main__':
 | 
						|
    initLoging("/var/log/cloud/setupManagement.log")
 | 
						|
    glbEnv = globalEnv()
 | 
						|
    
 | 
						|
    glbEnv.mode = "Server"
 | 
						|
    
 | 
						|
    print "Starting to configure CloudStack Management Server:"
 | 
						|
    syscfg = sysConfigFactory.getSysConfigFactory(glbEnv)
 | 
						|
    try:
 | 
						|
    	syscfg.registerService(cloudManagementConfig)
 | 
						|
        syscfg.config()
 | 
						|
        print "CloudStack Management Server setup is Done!"
 | 
						|
    except (CloudRuntimeException, CloudInternalException), e:
 | 
						|
        print e
 | 
						|
        print "Try to restore your system:"
 | 
						|
        try:
 | 
						|
            syscfg.restore()
 | 
						|
        except:
 | 
						|
            pass
 |