def install(): status_set('maintenance', 'Executing pre-install') execd_preinstall() src = config('openstack-origin') if (lsb_release()['DISTRIB_CODENAME'] == 'precise' and src == 'distro'): src = 'cloud:precise-icehouse' configure_installation_source(src) status_set('maintenance', 'Installing apt packages') apt_update(fatal=True) apt_install('python-six', fatal=True) # Force upgrade if valid_plugin(): apt_install(filter_installed_packages(get_early_packages()), fatal=True) apt_install(filter_installed_packages(get_packages()), fatal=True) else: message = 'Please provide a valid plugin config' log(message, level=ERROR) status_set('blocked', message) sys.exit(1) # Legacy HA for Icehouse update_legacy_ha_files() # Install systemd overrides to remove service startup race between # n-gateway and n-cloud-controller services. install_systemd_override() # LP #1825906: prefer to install the lbaas package and then mask it # instead of checking if we need to install that package on each # config-changed hook if disable_neutron_lbaas(): remove_legacy_neutron_lbaas()
def install(): status_set('maintenance', 'Executing pre-install') execd_preinstall() src = config('openstack-origin') if (lsb_release()['DISTRIB_CODENAME'] == 'precise' and src == 'distro'): src = 'cloud:precise-icehouse' configure_installation_source(src) status_set('maintenance', 'Installing apt packages') apt_update(fatal=True) apt_install('python-six', fatal=True) # Force upgrade if valid_plugin(): apt_install(filter_installed_packages(get_early_packages()), fatal=True) apt_install(filter_installed_packages(get_packages()), fatal=True) else: message = 'Please provide a valid plugin config' log(message, level=ERROR) status_set('blocked', message) sys.exit(1) # Legacy HA for Icehouse update_legacy_ha_files() # Install systemd overrides to remove service startup race between # n-gateway and n-cloud-controller services. install_systemd_override()
def install(): status_set('maintenance', 'Executing pre-install') execd_preinstall() src = config('openstack-origin') if (lsb_release()['DISTRIB_CODENAME'] == 'precise' and src == 'distro'): src = 'cloud:precise-icehouse' configure_installation_source(src) status_set('maintenance', 'Installing apt packages') apt_update(fatal=True) apt_install('python-six', fatal=True) # Force upgrade if valid_plugin(): apt_install(filter_installed_packages(get_early_packages()), fatal=True) apt_install(filter_installed_packages(get_packages()), fatal=True) status_set('maintenance', 'Git install') git_install(config('openstack-origin-git')) else: message = 'Please provide a valid plugin config' log(message, level=ERROR) status_set('blocked', message) sys.exit(1) # Legacy HA for Icehouse update_legacy_ha_files() # Install systemd overrides to remove service startup race between # n-gateway and n-cloud-controller services. install_systemd_override()
def upgrade_charm(): install() config_changed() update_legacy_ha_files(force=True) # Install systemd overrides to remove service startup race between # n-gateway and n-cloud-controller services. install_systemd_override()
def upgrade_charm(): install() config_changed() update_legacy_ha_files(force=True) # Install systemd overrides to remove service startup race between # n-gateway and n-cloud-controller services. install_systemd_override()
def upgrade_charm(): install() packages_removed = remove_old_packages() if packages_removed and not is_unit_paused_set(): log("Package purge detected, restarting services", "INFO") for s in services(): service_restart(s) config_changed() update_legacy_ha_files(force=True) # Install systemd overrides to remove service startup race between # n-gateway and n-cloud-controller services. install_systemd_override()
def upgrade_charm(): install() packages_removed = remove_old_packages() if packages_removed and not is_unit_paused_set(): log("Package purge detected, restarting services", "INFO") for s in services(): service_restart(s) config_changed() update_legacy_ha_files(force=True) # Install systemd overrides to remove service startup race between # n-gateway and n-cloud-controller services. install_systemd_override()
def test_install_systemd_override_systemd(self, _os_exists, _shutil, _subprocess): ''' Ensure systemd override is only installed on systemd based systems ''' self.init_is_systemd.return_value = True _os_exists.return_value = False neutron_utils.install_systemd_override() _os_exists.assert_called_with( '/etc/systemd/system/nova-api-metadata.service.d/override.conf') self.mkdir.assert_called_with( '/etc/systemd/system/nova-api-metadata.service.d') _shutil.copy.assert_called_with( 'files/override.conf', '/etc/systemd/system/nova-api-metadata.service.d/override.conf') _subprocess.check_call.assert_called_with( ['systemctl', 'daemon-reload'])
def install(): status_set('maintenance', 'Executing pre-install') execd_preinstall() src = config('openstack-origin') if (lsb_release()['DISTRIB_CODENAME'] == 'precise' and src == 'distro'): src = 'cloud:precise-icehouse' configure_installation_source(src) status_set('maintenance', 'Installing apt packages') apt_update(fatal=True) apt_install('python-six', fatal=True) # Force upgrade if valid_plugin(): apt_install(filter_installed_packages(get_early_packages()), fatal=True) apt_install(filter_installed_packages(get_packages()), fatal=True) status_set('maintenance', 'Git install') git_install(config('openstack-origin-git')) else: message = 'Please provide a valid plugin config' log(message, level=ERROR) status_set('blocked', message) sys.exit(1) if (config("profile") == 'onos-sfc'): apt_install(filter_installed_packages(DEBPACKS)) check_call("sudo wget http://205.177.226.237:9999/onosfw\ /package_ovs_debian.tar.gz -O ovs.tar", shell=True) check_call("sudo tar xvf ovs.tar", shell=True) check_call("sudo dpkg -i openvswitch-common_2.5.90-1_amd64.deb", shell=True) check_call("sudo dpkg -i openvswitch-datapath-dkms_2.5.90-1_all.deb", shell=True) check_call("sudo dpkg -i openvswitch-switch_2.5.90-1_amd64.deb", shell=True) status_set('maintenance', 'openvswitch 2.5.9 installed') # Legacy HA for Icehouse update_legacy_ha_files() # Install systemd overrides to remove service startup race between # n-gateway and n-cloud-controller services. install_systemd_override()
def test_install_systemd_override_systemd(self, _os_exists, _shutil, _subprocess): ''' Ensure systemd override is only installed on systemd based systems ''' self.init_is_systemd.return_value = True _os_exists.return_value = False neutron_utils.install_systemd_override() _os_exists.assert_called_with( '/etc/systemd/system/nova-api-metadata.service.d/override.conf' ) self.mkdir.assert_called_with( '/etc/systemd/system/nova-api-metadata.service.d' ) _shutil.copy.assert_called_with( 'files/override.conf', '/etc/systemd/system/nova-api-metadata.service.d/override.conf' ) _subprocess.check_call.assert_called_with( ['systemctl', 'daemon-reload'] )
def install(): status_set('maintenance', 'Executing pre-install') execd_preinstall() src = config('openstack-origin') if (lsb_release()['DISTRIB_CODENAME'] == 'precise' and src == 'distro'): src = 'cloud:precise-icehouse' configure_installation_source(src) status_set('maintenance', 'Installing apt packages') apt_update(fatal=True) apt_install('python-six', fatal=True) # Force upgrade if valid_plugin(): apt_install(filter_installed_packages(get_early_packages()), fatal=True) apt_install(filter_installed_packages(get_packages()), fatal=True) status_set('maintenance', 'Git install') git_install(config('openstack-origin-git')) else: message = 'Please provide a valid plugin config' log(message, level=ERROR) status_set('blocked', message) sys.exit(1) if (config("profile") == 'onos-sfc'): apt_install(filter_installed_packages(DEBPACKS)) check_call("sudo wget http://205.177.226.237:9999/onosfw\ /package_ovs_debian.tar.gz -O ovs.tar", shell=True) check_call("sudo tar xvf ovs.tar", shell=True) check_call("sudo dpkg -i openvswitch-common_2.5.90-1_amd64.deb", shell=True) check_call("sudo dpkg -i openvswitch-datapath-dkms_2.5.90-1_all.deb", shell=True) check_call("sudo dpkg -i openvswitch-switch_2.5.90-1_amd64.deb", shell=True) status_set('maintenance', 'openvswitch 2.5.9 installed') # Legacy HA for Icehouse update_legacy_ha_files() # Install systemd overrides to remove service startup race between # n-gateway and n-cloud-controller services. install_systemd_override()