def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    # If attempting to upgrade from Stein->Train, block until Placement
    # charm is related. Status is set in check_optional_relations().
    release = ch_utils.os_release('nova-common')
    cmp_os_release = ch_utils.CompareOpenStackReleases(release)
    if (cmp_os_release == 'stein' and not hookenv.relation_ids('placement')):
        return

    if (ch_utils.do_action_openstack_upgrade('nova-common',
                                             utils.do_openstack_upgrade,
                                             hooks.CONFIGS)):
        for rid in hookenv.relation_ids('neutron-api'):
            hooks.neutron_api_relation_joined(rid=rid, remote_restart=True)
        # NOTE(thedac): Force re-fire of shared-db joined hook
        # to ensure that nova_api database is setup if required.
        for r_id in hookenv.relation_ids('shared-db'):
            hooks.db_joined(relation_id=r_id)
        hooks.config_changed()
Esempio n. 2
0
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('swift', do_openstack_upgrade, CONFIGS)):
        config_changed()
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if do_action_openstack_upgrade(get_common_package(), do_openstack_upgrade, CONFIGS):
        config_changed()
Esempio n. 4
0
def openstack_upgrade():
    """Perform action-managed OpenStack upgrade.

    Upgrades packages to the configured openstack-origin version and sets
    the corresponding action status as a result.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag (action-managed-upgrade) must
    be set for this code to run, otherwise a full service level upgrade will
    fire on config-changed."""

    if do_action_openstack_upgrade("keystone", do_openstack_upgrade, CONFIGS):
        config_changed()
def openstack_upgrade():
    """Perform action-managed OpenStack upgrade.

    Upgrades packages to the configured openstack-origin version and sets
    the corresponding action status as a result.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag (action-managed-upgrade) must
    be set for this code to run, otherwise a full service level upgrade will
    fire on config-changed."""

    if (do_action_openstack_upgrade('keystone', do_openstack_upgrade,
                                    CONFIGS)):
        os.execl('./hooks/config-changed-postupgrade', '')
Esempio n. 6
0
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('nova-common',
                                    do_openstack_upgrade,
                                    CONFIGS)):
        [neutron_api_relation_joined(rid=rid, remote_restart=True)
            for rid in relation_ids('neutron-api')]
        config_changed()
def openstack_upgrade():
    """Perform action-managed OpenStack upgrade.

    Upgrades packages to the configured openstack-origin version and sets
    the corresponding action status as a result.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag (action-managed-upgrade) must
    be set for this code to run, otherwise a full service level upgrade will
    fire on config-changed."""

    if (do_action_openstack_upgrade('keystone',
                                    do_openstack_upgrade,
                                    register_configs())):
        os.execl('./hooks/config-changed-postupgrade', '')
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('nova-common', do_openstack_upgrade,
                                    CONFIGS)):
        [
            neutron_api_relation_joined(rid=rid, remote_restart=True)
            for rid in relation_ids('neutron-api')
        ]
        config_changed()
Esempio n. 9
0
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('cinder-common',
                                    do_openstack_upgrade,
                                    CONFIGS)):
        # tell any storage-backends we just upgraded
        for rid in relation_ids('storage-backend'):
            relation_set(relation_id=rid,
                         upgrade_nonce=uuid.uuid4())
        config_changed()
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (ch_utils.do_action_openstack_upgrade('nova-common',
                                             utils.do_openstack_upgrade,
                                             hooks.CONFIGS)):
        for rid in hookenv.relation_ids('neutron-api'):
            hooks.neutron_api_relation_joined(rid=rid, remote_restart=True)
        # NOTE(thedac): Force re-fire of shared-db joined hook
        # to ensure that nova_api database is setup if required.
        for r_id in hookenv.relation_ids('shared-db'):
            hooks.db_joined(relation_id=r_id)
        hooks.config_changed()
Esempio n. 11
0
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (ch_utils.do_action_openstack_upgrade('nova-common',
                                             utils.do_openstack_upgrade,
                                             hooks.CONFIGS)):
        for rid in hookenv.relation_ids('neutron-api'):
            hooks.neutron_api_relation_joined(rid=rid, remote_restart=True)
        # NOTE(thedac): Force re-fire of shared-db joined hook
        # to ensure that nova_api database is setup if required.
        for r_id in hookenv.relation_ids('shared-db'):
            hooks.db_joined(relation_id=r_id)
        hooks.config_changed()
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('nova-common', do_openstack_upgrade,
                                    CONFIGS)):
        # we should restart the container scoped (subordinate) plugins after a
        # managed openstack upgrade see: BUG#1835557
        for rid in relation_ids('neutron-plugin'):
            neutron_plugin_joined(rid, remote_restart=True)
        for rid in relation_ids('nova-ceilometer'):
            nova_ceilometer_joined(rid, remote_restart=True)
        # NOTE(ajkavanagh) - if unit is paused (usually true for managed
        # upgrade) then the config_changed() function is a no-op
        config_changed()
Esempio n. 13
0
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('cinder-common',
                                    do_openstack_upgrade,
                                    configs=None)):
        # tell any storage-backends we just upgraded
        for rid in relation_ids('storage-backend'):
            relation_set(relation_id=rid,
                         upgrade_nonce=uuid.uuid4())

        # Force reload to get any chances resulting from upgrade.
        # See LP 1726527.
        cinder_hooks.CONFIGS = register_configs()
        cinder_hooks.config_changed()
Esempio n. 14
0
def openstack_upgrade():
    """Upgrade packages to config-set Openstack version.

    If the charm was installed from source we cannot upgrade it.
    For backwards compatibility a config flag must be set for this
    code to run, otherwise a full service level upgrade will fire
    on config-changed."""

    if (do_action_openstack_upgrade('cinder-common',
                                    do_openstack_upgrade,
                                    configs=None)):
        # tell any storage-backends we just upgraded
        for rid in relation_ids('storage-backend'):
            relation_set(relation_id=rid,
                         upgrade_nonce=uuid.uuid4())

        # Force reload to get any chances resulting from upgrade.
        # See LP 1726527.
        cinder_hooks.CONFIGS = register_configs()
        # If we are paused, resume LP Bug #1824545
        if is_unit_paused_set():
            resume_unit_helper(cinder_hooks.register_configs())
        cinder_hooks.config_changed()