if __name__ == '__main__':
    print 'hello openstack-icehouse:keystone============'
    
    print 'start time: %s' % time.ctime()
    #when execute script,exec: python <this file absolute path>
    #The params are retrieved from conf/openstack_params.json & /opt/localip, these two files are generated in init.pp in site.pp.
    ###############################
    INSTALL_TAG_FILE = '/opt/initNeutronServer'
    
    if os.path.exists(INSTALL_TAG_FILE) :
        print 'neutron-server initted####'
        print 'exit===='
    else :
        NeutronServer.start()
        #add HA
        NeutronServerHA.install()
        NeutronServerHA.configure()
        NeutronServerHA.start()
        
        ##########################
        NeutronServer.restart()
        NeutronServerHA.start()
        
    #     os.system("service openstack-keystone restart")
    #     
    #     os.system("service haproxy restart")
        
        #mark: keystone is installed
        os.system('touch %s' % INSTALL_TAG_FILE)
    print 'hello openstack-icehouse:neutron-server initted#######'
    pass
Exemple #2
0
        pass
    pass
    
if __name__ == '__main__':
    print 'hello openstack-icehouse:init ostf============'
    print 'start time: %s' % time.ctime()
    #when execute script,exec: python <this file absolute path>
    ###############################
    if Role.isNeutronServerRole() :
        NETWORK_INSTALL_TAG_FILE = '/opt/initOSTFNetwork'
        if os.path.exists(NETWORK_INSTALL_TAG_FILE) :
            print 'ostf network initted####'
            print 'exit===='
            pass
        else :
            if NeutronServerHA.isMasterNode() :
                network_init_script_path = os.path.join(OPENSTACK_CONF_FILE_TEMPLATE_DIR, 'neutron-server', 'ostf_network_init.sh')
                ShellCmdExecutor.execCmd('cp -r %s /opt/' % network_init_script_path)
                ############
                keystone_vip = JSONUtility.getValue('keystone_vip')
                
                ShellCmdExecutor.execCmd('chmod 777 /opt/ostf_network_init.sh')
                FileUtil.replaceFileContent('/opt/ostf_network_init.sh', '<KEYSTONE_VIP>', keystone_vip)
                
                ###########
                ShellCmdExecutor.execCmd('bash /opt/ostf_network_init.sh')
                pass
    
            #mark: OSTF network is installed
            os.system('touch %s' % NETWORK_INSTALL_TAG_FILE)
            pass