Пример #1
0
def mod_novnc():
    astute = utils.get_astute()
    if astute:
        filename = '/etc/nova/nova.conf'
        orig_filename = filename + ".orig"
        if not os.path.exists(orig_filename):
            shutil.copyfile(filename, orig_filename)
        cf = ConfigParser.ConfigParser()
        try:
            cf.read(orig_filename)
            if not cf.has_section('cache'):
                cf.add_section('cache')
            cf.set('cache', 'enable', 'True')
            memcached_servers = cf.get('keystone_authtoken',
                                       'memcached_servers')
            cf.set('cache', 'memcached_servers', memcached_servers)
            cf.set('DEFAULT', 'memcached_servers', memcached_servers)
            with open(filename, 'w') as configfile:
                cf.write(configfile)
            LOG.info('%s created' % filename)
            utils.execute('service', 'nova-novncproxy', 'restart')
            utils.execute('service', 'nova-consoleauth', 'restart')
        except Exception:
            utils.reportError('Cannot set configurations to %s' % filename)
def mod_novnc():
    astute = utils.get_astute()
    if astute:
        filename = '/etc/nova/nova.conf'
        orig_filename = filename + ".orig"
        if not os.path.exists(orig_filename):
            shutil.copyfile(filename, orig_filename)
        cf = ConfigParser.ConfigParser()
        try:
            cf.read(orig_filename)
            if not cf.has_section('cache'):
                cf.add_section('cache')
            cf.set('cache', 'enable', 'True')
            memcached_servers = cf.get('keystone_authtoken',
                                       'memcached_servers')
            cf.set('cache', 'memcached_servers', memcached_servers)
            cf.set('DEFAULT', 'memcached_servers', memcached_servers)
            with open(filename, 'w') as configfile:
                cf.write(configfile)
            LOG.info('%s created' % filename)
            utils.execute('service', 'nova-novncproxy', 'restart')
            utils.execute('service', 'nova-consoleauth', 'restart')
        except Exception:
            utils.reportError('Cannot set configurations to %s' % filename)
Пример #3
0
        utils.ssh_detailed(himn,
                           username,
                           'systemctl',
                           'disable',
                           AUTO_START_SERVICE,
                           allowed_return_codes=[0, 1])
        utils.ssh(himn, username, 'rm', '-f',
                  '/etc/systemd/system/%s' % AUTO_START_SERVICE)
        utils.ssh(himn, username, 'rm', '-f',
                  '/etc/sysconfig/network-scripts/%s' % AUTO_SCRIPT)
        utils.ssh(himn, username, 'systemctl', 'daemon-reload')


if __name__ == '__main__':
    install_xenapi_sdk()
    astute = utils.get_astute()
    if astute:
        username, password, install_xapi = utils.get_options(astute)
        endpoints = get_endpoints(astute)
        himn_eth, himn_local = utils.init_eth()

        public_ip = utils.astute_get(
            astute, ('network_metadata', 'vips', 'public', 'ipaddr'))

        services_ssl = utils.astute_get(astute, ('public_ssl', 'services'))

        if username and password and endpoints and himn_local:
            route_to_compute(endpoints, HIMN_IP, himn_local, username)
            xcp_version = utils.get_xcp_version(HIMN_IP, username)
            if install_xapi:
                install_suppack(HIMN_IP, username, XS_PLUGIN_ISO, xcp_version)
        utils.ssh(himn, username,
                  'mv',
                  '/etc/conntrackd/conntrackd.conf',
                  '/etc/conntrackd/conntrackd.conf.back')
        utils.ssh(himn, username,
                  'cp',
                  CONNTRACK_CONF_SAMPLE,
                  '/etc/conntrackd/conntrackd.conf')

    # Restart conntrackd service
    utils.ssh(himn, username, 'service', 'conntrackd', 'restart')


if __name__ == '__main__':
    install_xenapi_sdk()
    astute = utils.get_astute()
    if astute:
        username, password, install_xapi = utils.get_options(astute)
        endpoints = get_endpoints(astute)
        himn_eth, himn_local = utils.init_eth()

        public_ip = utils.astute_get(
            astute, ('network_metadata', 'vips', 'public', 'ipaddr'))

        services_ssl = utils.astute_get(
            astute, ('public_ssl', 'services'))

        if username and password and endpoints and himn_local:
            route_to_compute(endpoints, HIMN_IP, himn_local, username)
            if install_xapi:
                install_suppack(HIMN_IP, username, XS_PLUGIN_ISO)