def test_get_packages_mitaka(self): self.get_os_codename_install_source.return_value = 'mitaka' self.token_cache_pkgs.return_value = ['memcached'] self.assertEqual(utils.get_packages(), utils.CEILOMETER_BASE_PACKAGES + utils.MITAKA_PACKAGES + ['memcached'])
def test_get_packages_rocky(self): self.get_os_codename_package.return_value = 'rocky' self.token_cache_pkgs.return_value = [] self.assertEqual(sorted(utils.get_packages()), sorted([p for p in utils.CEILOMETER_AGENT_PACKAGES if not p.startswith('python-')] + ['python3-ceilometer', 'python3-memcache']))
def install(): status_set('maintenance', 'Installing apt packages') apt_update(fatal=True) # Install -common package so we get accurate version determination apt_install(filter_installed_packages(['ceilometer-common']), fatal=True) apt_install( filter_installed_packages(get_packages()), fatal=True)
def install(): execd_preinstall() origin = config('openstack-origin') if (lsb_release()['DISTRIB_CODENAME'] == 'precise' and origin == 'distro'): origin = 'cloud:precise-grizzly' configure_installation_source(origin) apt_update(fatal=True) apt_install(filter_installed_packages(get_packages()), fatal=True) open_port(CEILOMETER_PORT)
def config_changed(): # if we are paused, delay doing any config changed hooks. # It is forced on the resume. if is_unit_paused_set(): log("Unit is pause or upgrading. Skipping config_changed", "WARN") return apt_install(filter_installed_packages(get_packages()), fatal=True) if is_relation_made('nrpe-external-master'): update_nrpe_config() CONFIGS.write_all()
def upgrade_charm(): apt_install( filter_installed_packages(get_packages()), fatal=True) 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) # NOTE(jamespage): Ensure any changes to nova presented data are made # during charm upgrades. for rid in relation_ids('nova-ceilometer'): nova_ceilometer_joined(rid)
def install(): origin = config('openstack-origin') configure_installation_source(origin) status_set('maintenance', 'Installing apt packages') apt_update(fatal=True) apt_install(filter_installed_packages(CEILOMETER_AGENT_PACKAGES), fatal=True) # Call apt_install a 2nd time to allow packages which are enabled # for specific OpenStack version to be installed . This is because # Openstack version for a subordinate should be derived from the # version of an installed package rather than relying on # openstack-origin which would not be present in a subordinate. apt_install(filter_installed_packages(get_packages()), fatal=True)
def install(): execd_preinstall() origin = config('openstack-origin') if (lsb_release()['DISTRIB_CODENAME'] == 'precise' and origin == 'distro'): origin = 'cloud:precise-grizzly' configure_installation_source(origin) packages = filter_installed_packages(get_packages()) if packages: status_set('maintenance', 'Installing packages') apt_update(fatal=True) apt_install(packages, fatal=True) if init_is_systemd(): # NOTE(jamespage): ensure systemd override folder exists prior to # attempting to write override.conf mkdir(os.path.dirname(CEILOMETER_API_SYSTEMD_CONF)) if run_in_apache(): disable_package_apache_site()
def test_get_packages_queens(self): self.get_os_codename_install_source.return_value = 'queens' self.token_cache_pkgs.return_value = [] self.assertEqual(utils.get_packages(), utils.QUEENS_PACKAGES)
def test_get_packages_icehouse(self): self.get_os_codename_install_source.return_value = 'icehouse' self.token_cache_pkgs.return_value = [] self.assertEqual(utils.get_packages(), utils.CEILOMETER_BASE_PACKAGES + utils.ICEHOUSE_PACKAGES)
def test_get_packages(self): self.get_os_codename_install_source.return_value = 'havana' self.assertEqual(utils.get_packages(), utils.CEILOMETER_BASE_PACKAGES)
def upgrade_charm(): apt_install(filter_installed_packages(get_packages()), fatal=True)
def test_get_packages_rocky(self): self.get_os_codename_install_source.return_value = 'rocky' self.token_cache_pkgs.return_value = [] self.assertEqual(utils.get_packages(), utils.QUEENS_PACKAGES + ['python3-ceilometer'])
def test_get_packages_queens(self): self.get_os_codename_package.return_value = 'queens' self.token_cache_pkgs.return_value = [] self.assertEqual(utils.get_packages(), utils.CEILOMETER_AGENT_PACKAGES)