Exemplo n.º 1
0
 def sync_database(self):
     LOG.debug("populating neutron database")
     util.run_command('su -s /bin/sh -c "neutron-db-manage '
                      '--config-file /etc/neutron/neutron.conf '
                      '--config-file /etc/neutron/plugins/ml2/ml2_conf.ini '
                      'upgrade head" neutron')
     if util.str2bool(CONF['CONFIG_LBAAS_INSTALL']):
         util.run_command('su -s /bin/sh -c "neutron-db-manage '
                          '--service lbaas upgrade head"')
    def add_selectionprocess(self, idclient, idjobposition, idcandidate,
                             date_registered, user_register,
                             user_registered_byself):
        user_registered_byself = str2bool(user_registered_byself)

        new_selectionprocess = SelectionProcessCandidate(
            idclient, idjobposition, idcandidate, date_registered,
            user_register, user_registered_byself)
        db.session.add(new_selectionprocess)
        db.session.commit()
        return selectionprocess_candidate_schema.jsonify(new_selectionprocess)
    def add_selectionprocess(self, idclient, idjobposition, date_process_begin,
                             date_process_end, user_register, process_active):
        process_active = str2bool(process_active)

        new_selectionprocess = SelectionProcess(idclient, idjobposition,
                                                date_process_begin,
                                                date_process_end,
                                                user_register, process_active)
        db.session.add(new_selectionprocess)
        db.session.commit()
        return selectionprocess_schema.jsonify(new_selectionprocess)
    def update_selectionprocess(self, idclient, idjobposition, idcandidate,
                                date_registered, user_register,
                                user_registered_byself):
        user_registered_byself = str2bool(user_registered_byself)

        selectionprocess = SelectionProcessCandidate.query.get(
            (idclient, idjobposition, idcandidate))
        selectionprocess.date_registered = date_registered
        selectionprocess.user_register = user_register
        selectionprocess.user_registered_byself = user_registered_byself

        db.session.commit()
        return selectionprocess_candidate_schema.jsonify(selectionprocess)
    def update_selectionprocess(self, idclient, idjobposition,
                                date_process_begin, date_process_end,
                                user_register, process_active):
        selectionprocess = SelectionProcess.query.get(
            (idclient, idjobposition))

        if selectionprocess:
            process_active = str2bool(process_active)

            selectionprocess.date_process_begin = date_process_begin
            selectionprocess.date_process_end = date_process_end
            selectionprocess.user_register = user_register
            selectionprocess.process_active = process_active
        else:
            selectionprocess = self.add_selectionprocess(
                idclient, idjobposition, date_process_begin, date_process_end,
                user_register, process_active)

        db.session.commit()
        return selectionprocess_schema.jsonify(selectionprocess)
Exemplo n.º 6
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from common import util
from modules.conf import CONF
from modules.glance import Glance


glance = Glance.get()
config_files = ["/etc/glance/glance-api.conf"]
config_files.append("/etc/glance/glance-registry.conf")

glance.install()
glance.create_user()
glance.create_service()
glance.create_endpoint()

for config_file in config_files:
    glance.config_debug(config_file)
    glance.config_database(config_file)
    glance.config_auth(config_file)
    if util.str2bool(CONF['CONFIG_CEILOMETER_INSTALL']):
        glance.ceilometer_enable(config_file)

util.run_command("systemctl restart update-triggers.target")
glance.sync_database()
glance.start_server()
Exemplo n.º 7
0
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from modules.glance import Glance
from modules.neutron import Neutron
from modules.nova import Nova
from modules.conf import CONF
from common import util

glance = Glance.get()
nova = Nova.get()
neutron = Neutron.get()

if util.str2bool(CONF['CONFIG_PROVISION_DEMO']):
    name = CONF['CONFIG_PROVISION_IMAGE_NAME']
    format = CONF['CONFIG_PROVISION_IMAGE_FORMAT']
    url = CONF['CONFIG_PROVISION_IMAGE_URL']
    glance.create_image(name, format, url, public=True)
    floating_range = CONF['CONFIG_PROVISION_DEMO_FLOATRANGE']
    neutron.create_network('private', '10.0.0.0/24', public=False)
    neutron.create_network('public', floating_range, public=True)
    neutron.create_router('router', gw='public', interfaces=['private'])
Exemplo n.º 8
0
neutron.create_endpoint()

# Configure neutron controller
neutron.config_debug(config_file)
neutron.config_database(config_file)
neutron.config_rabbitmq(config_file)
neutron.config_auth(config_file)

neutron.config_nova(config_file)
neutron.config_ml2_plugin()
neutron.config_linux_bridge_agent(local_ip, local_nic)
neutron.config_l3_agent("/etc/neutron/l3_agent.ini")
neutron.config_dhcp_agent("/etc/neutron/dhcp_agent.ini")
neutron.config_metadata_agent("/etc/neutron/metadata_agent.ini")
neutron.config_neutron_on_nova("/etc/nova/nova.conf")

if util.str2bool(CONF['CONFIG_CEILOMETER_INSTALL']):
    neutron.ceilometer_enable(config_file)

if util.str2bool(CONF['CONFIG_LBAAS_INSTALL']):
    neutron.install('openstack-lbaas')
    neutron.config_lbaas()

if util.str2bool(CONF['CONFIG_VPNAAS_INSTALL']):
    neutron.install('openstack-vpnaas')
    neutron.config_vpnaas()

util.run_command("systemctl restart update-triggers.target")
neutron.sync_database()
neutron.start_server()
Exemplo n.º 9
0
 def config_debug(self, configfile):
     if util.str2bool(CONF['CONFIG_DEBUG_MODE']):
         config = "[DEFAULT]\n" + \
                  "debug=True\n" + \
                  "verbose=True\n"
         util.write_config(configfile, config)
Exemplo n.º 10
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from common.util import LOG
from common import util
from modules.conf import CONF
from modules.mariadb import MariaDB

conf = CONF
mariadb = MariaDB.get()
mariadb_user = CONF["CONFIG_MARIADB_USER"]
mariadb_pw = CONF["CONFIG_MARIADB_PW"]

if util.str2bool(conf['CONFIG_MARIADB_INSTALL']):
    mariadb.install()
    mariadb.configure()
    mariadb.start_server()
    mariadb.secure_installation(mariadb_user, mariadb_pw)

databases = ['keystone', 'glance', 'nova', 'neutron', 'heat', 'sahara']

for database in databases:
    if database == 'keystone' or util.str2bool(conf['CONFIG_%s_INSTALL'
                                               % database.upper()]):
        LOG.info("Setting up mariadb for %s" % database)
        password = CONF['CONFIG_%s_DB_PW' % database.upper()]
        mariadb.setup_database(database, database, password)
Exemplo n.º 11
0
def events():
    offset = int(request.args.get('offset', 0))
    onlyOutage = util.str2bool(request.args.get('onlyOutage', False))
    events = EventsManager.getEvents(offset, onlyOutage)
    return jsonify(events)
Exemplo n.º 12
0
nova.install_compute()
nova.config_debug(config_file)
nova.config_rabbitmq(config_file)
nova.config_auth(config_file)

# Setup vncproxy server
config = (
    "[DEFAULT]\n"
    "my_ip={0}\n"
    "[vnc]\n"
    "vnc_enabled=True\n"
    "vncserver_listen=0.0.0.0\n"
    "vncserver_proxyclient_address={0}\n"
    "novncproxy_base_url=http://{1}:6080/vnc_auto.html\n".format(my_ip, CONF["CONFIG_CONTROLLER_HOST"])
)

# Setup glance host
config += ("[glance]\n" "host=%s\n") % CONF["CONFIG_CONTROLLER_HOST"]

# Disable HW acceleration on unsupported HW
if not clearlinux.support_hw_acceleration():
    config += "[libvirt]\n" "virt_type=qemu\n"

util.write_config(config_file, config)

if util.str2bool(CONF["CONFIG_CEILOMETER_INSTALL"]):
    nova.ceilometer_enable(config_file)

util.run_command("systemctl restart update-triggers.target")
nova.start_server(services)
Exemplo n.º 13
0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from common.util import LOG
from common import util
from modules.conf import CONF
from modules.mariadb import MariaDB

conf = CONF
mariadb = MariaDB.get()
mariadb_user = CONF["CONFIG_MARIADB_USER"]
mariadb_pw = CONF["CONFIG_MARIADB_PW"]

if util.str2bool(conf["CONFIG_MARIADB_INSTALL"]):
    mariadb.install()
    mariadb.configure()
    mariadb.start_server()
    mariadb.secure_installation(mariadb_user, mariadb_pw)

databases = ["keystone", "glance", "nova", "neutron", "heat"]

for database in databases:
    if database == "keystone" or util.str2bool(conf["CONFIG_%s_INSTALL" % database.upper()]):
        LOG.info("Setting up mariadb for %s" % database)
        password = CONF["CONFIG_%s_DB_PW" % database.upper()]
        mariadb.setup_database(database, database, password)
Exemplo n.º 14
0
# Copyright (c) 2015 Intel Corporation
#
# Author: Alberto Murillo <*****@*****.**>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from common import util
from modules.conf import CONF
from modules.mongodb import MongoDB

mongo = MongoDB.get()

if util.str2bool(CONF['CONFIG_MONGODB_INSTALL']):
    mongo.install()
    mongo.configure()
    mongo.start_server()

mongo.setup_database('ceilometer', 'ceilometer',
                     CONF['CONFIG_CEILOMETER_DB_PW'])