mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			33 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			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
 | 
						|
from optparse import OptionParser
 | 
						|
if __name__ == '__main__':
 | 
						|
    initLoging("/var/log/cloud/setupManagement.log")
 | 
						|
    glbEnv = globalEnv()
 | 
						|
    
 | 
						|
    parser = OptionParser()
 | 
						|
    parser.add_option("--https", action="store_true", dest="https", help="Enable HTTPs connection of management server")
 | 
						|
    (options, args) = parser.parse_args()
 | 
						|
    if options.https:
 | 
						|
        glbEnv.svrMode = "HttpsServer"
 | 
						|
 | 
						|
    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
 |