コード例 #1
0
def install():
    status_set('maintenance', 'Executing pre-install')
    execd_preinstall()
    configure_installation_source(config('openstack-origin'))

    status_set('maintenance', 'Installing apt packages')
    apt_update()
    apt_install(determine_packages(), fatal=True)

    if placement_api_enabled():
        disable_package_apache_site()

    git_install(config('openstack-origin-git'))

    _files = os.path.join(charm_dir(), 'files')
    if os.path.isdir(_files):
        for f in os.listdir(_files):
            f = os.path.join(_files, f)
            if os.path.isfile(f):
                log('Installing %s to /usr/bin' % f)
                shutil.copy2(f, '/usr/bin')
    [open_port(port) for port in determine_ports()]
    msg = 'Disabling services into db relation joined'
    log(msg)
    status_set('maintenance', msg)
    disable_services()
    cmd_all_services('stop')
コード例 #2
0
def db_departed():
    CONFIGS.write_all()
    update_cell_db_if_ready(skip_acl_check=True)
    for r_id in relation_ids('cluster'):
        relation_set(relation_id=r_id, dbsync_state='incomplete')
    disable_services()
    cmd_all_services('stop')
コード例 #3
0
def db_departed():
    CONFIGS.write_all()
    if CompareOpenStackReleases(os_release('nova-common')) >= 'ocata':
        update_cell_db_if_ready(skip_acl_check=True)
    for r_id in relation_ids('cluster'):
        relation_set(relation_id=r_id, dbsync_state='incomplete')
    disable_services()
    cmd_all_services('stop')
コード例 #4
0
def cluster_changed():
    CONFIGS.write_all()
    if relation_ids('cluster'):
        peer_echo(includes=['dbsync_state'])
        dbsync_state = peer_retrieve('dbsync_state')
        if dbsync_state == 'complete':
            enable_services()
            cmd_all_services('start')
        else:
            log('Database sync not ready. Shutting down services')
            disable_services()
            cmd_all_services('stop')
コード例 #5
0
def cluster_changed():
    CONFIGS.write_all()
    if relation_ids('cluster'):
        peer_echo(includes=['dbsync_state'])
        dbsync_state = peer_retrieve('dbsync_state')
        if dbsync_state == 'complete':
            enable_services()
            cmd_all_services('start')
        else:
            log('Database sync not ready. Shutting down services')
            disable_services()
            cmd_all_services('stop')
コード例 #6
0
def install():
    status_set('maintenance', 'Executing pre-install')
    execd_preinstall()
    configure_installation_source(config('openstack-origin'))

    status_set('maintenance', 'Installing apt packages')
    apt_update()
    apt_install(determine_packages(), fatal=True)

    git_install(config('openstack-origin-git'))

    _files = os.path.join(charm_dir(), 'files')
    if os.path.isdir(_files):
        for f in os.listdir(_files):
            f = os.path.join(_files, f)
            if os.path.isfile(f):
                log('Installing %s to /usr/bin' % f)
                shutil.copy2(f, '/usr/bin')
    [open_port(port) for port in determine_ports()]
    msg = 'Disabling services into db relation joined'
    log(msg)
    status_set('maintenance', msg)
    disable_services()
    cmd_all_services('stop')
コード例 #7
0
def db_departed():
    CONFIGS.write_all()
    for r_id in relation_ids('cluster'):
        relation_set(relation_id=r_id, dbsync_state='incomplete')
    disable_services()
    cmd_all_services('stop')
コード例 #8
0
def db_departed():
    CONFIGS.write_all()
    for r_id in relation_ids('cluster'):
        relation_set(relation_id=r_id, dbsync_state='incomplete')
    disable_services()
    cmd_all_services('stop')