Cleanup ceilometer from bare metal code

Ceilometer is being setup through helm charts in containers
so the references to ceilometer in bare metal can be cleaned up.

 - Removing the sysinv puppet code for ceilometer
 - Removing the bare metal ceilometer pipeline upgrade script
 - Cleaning up unused variables from templates

Story: 2004764
Task: 33690
Change-Id: I2efe7aed7a4570121c1376c132e157c6f47e9f29
This commit is contained in:
Al Bailey 2019-04-30 11:44:34 -05:00
parent 06ae2b8c33
commit 99077bad0e
10 changed files with 1 additions and 168 deletions

View File

@ -3030,12 +3030,6 @@ class ConfigAssistant():
self.system_controller_floating_ip = config.get(
'cREGION', 'SYSTEM_CONTROLLER_FLOATING_ADDRESS')
# Deprecated Ceilometer time_to_live option.
# made this a ceilometer service parameter.
if config.has_option('cCEILOMETER', 'TIME_TO_LIVE'):
raise ConfigFail("The option TIME_TO_LIVE is "
"no longer supported")
except Exception:
print("Error parsing answer file")
raise

View File

@ -42,9 +42,6 @@ FAKE_SERVICE_DATA = {u'services': [
{u'type': u'object-store', u'description': u'OpenStack object-store',
u'enabled': True, u'id': u'd588956f759f4bbda9e65a1019902b9c',
u'name': u'swift'},
{u'type': u'metering', u'description': u'OpenStack Metering Service',
u'enabled': True, u'id': u'4c07eadd3d0c45eb9a3b1507baa278ba',
u'name': u'ceilometer'},
{u'type': u'volumev2',
u'description': u'OpenStack Volume Service v2.0 API',
u'enabled': True, u'id': u'e6e356112daa4af588d9b9dadcf98bc4',

View File

@ -75,9 +75,6 @@ def get_db_credentials(shared_services, from_release):
{'barbican': {'hiera_user_key': 'barbican::db::postgresql::user',
'keyring_password_key': 'barbican',
},
'ceilometer': {'hiera_user_key': 'ceilometer::db::postgresql::user',
'keyring_password_key': 'ceilometer',
},
'heat': {'hiera_user_key': 'heat::db::postgresql::user',
'keyring_password_key': 'heat',
},
@ -527,10 +524,6 @@ def migrate_databases(from_release, shared_services, db_credentials,
# Create minimal config files for each OpenStack service so they can
# run their database migration.
with open("/etc/ceilometer/ceilometer-dbsync.conf", "w") as f:
f.write("[database]\n")
f.write(get_connection_string(db_credentials, 'ceilometer'))
with open("/etc/heat/heat-dbsync.conf", "w") as f:
f.write("[database]\n")
f.write(get_connection_string(db_credentials, 'heat'))
@ -577,10 +570,6 @@ def migrate_databases(from_release, shared_services, db_credentials,
('barbican',
'barbican-manage --config-file /etc/barbican/barbican-dbsync.conf ' +
'db upgrade'),
# Migrate ceilometer
('ceilometer',
'ceilometer-upgrade --skip-gnocchi-resource-types --config-file ' +
'/etc/ceilometer/ceilometer-dbsync.conf'),
# Migrate heat
('heat',
'heat-manage --config-file /etc/heat/heat-dbsync.conf db_sync'),

View File

@ -1,56 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2016-2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Migrates ceilometer pipeline file.
. /usr/bin/tsconfig
NAME=$(basename $0)
# The migration scripts are passed these parameters:
FROM_RELEASE=$1
TO_RELEASE=$2
ACTION=$3
# This will log to /var/log/platform.log
function log {
logger -p local1.info $1
}
OLD_PIPELINE_FILE="${CGCS_PATH}/ceilometer/${FROM_RELEASE}/pipeline.yaml"
NEW_PIPELINE_DIR="${CGCS_PATH}/ceilometer/${TO_RELEASE}"
NEW_PIPELINE_FILE="${NEW_PIPELINE_DIR}/pipeline.yaml"
PIPELINE_SOURCE_FILE=/etc/ceilometer/controller.yaml
function do_escape {
local val=$1
local val_escaped="${val//\//\\/}"
val_escaped="${val_escaped//\&/\\&}"
echo $val_escaped
}
if [ "$ACTION" == "migrate" ]; then
log "Creating new $NEW_PIPELINE_FILE file for release $TO_RELEASE"
if [ ! -d "$NEW_PIPELINE_DIR" ]; then
mkdir $NEW_PIPELINE_DIR
fi
cp $PIPELINE_SOURCE_FILE $NEW_PIPELINE_FILE
# Currently, the user can only modify the vswitch.csv and pm.csv paths.
default_value=$(do_escape "$(awk '/vswitch.csv/ {print $0}' $NEW_PIPELINE_FILE)")
custom_value=$(do_escape "$(awk '/vswitch.csv/ {print $0}' $OLD_PIPELINE_FILE)")
sed -i "s/$default_value/$custom_value/" $NEW_PIPELINE_FILE
default_value=$(do_escape "$(awk '/pm.csv/ {print $0}' $NEW_PIPELINE_FILE)")
custom_value=$(do_escape "$(awk '/pm.csv/ {print $0}' $OLD_PIPELINE_FILE)")
sed -i "s/$default_value/$custom_value/" $NEW_PIPELINE_FILE
chmod 640 $NEW_PIPELINE_FILE
fi
exit 0

View File

@ -10,7 +10,6 @@ keystone_auth_uri = <%= @auth_uri %> ; keystone auth uri
keystone_auth_port = <%= @auth_port %> ; keystone auth port
keystone_region_name = <%= @auth_region %> ; keystone region
keyring_directory = <%= @keyring_directory %> ; keyring directory
ceilometer_port = <%= @ceilometer_port %> ; ceilometer rest api port
multicast = <%= @mtce_multicast %> ; Heartbeat Multicast Address
heartbeat_period = <%= @heartbeat_period %> ; Heartbeat period in milliseconds
heartbeat_failure_threshold = <%= @heartbeat_failure_threshold %> ; Heartbeat failure threshold count.

View File

@ -49,7 +49,7 @@ def _get_endpoint(client, **kwargs):
def get_client(api_version, **kwargs):
"""Get an authtenticated client, based on the credentials
"""Get an authenticated client, based on the credentials
in the keyword args.
:param api_version: the API version to use ('1' or '2')
@ -74,8 +74,6 @@ def get_client(api_version, **kwargs):
token = kwargs.get('os_auth_token')
endpoint = kwargs.get('system_url')
auth_ref = None
ceilometer_endpoint = None
elif (kwargs.get('os_username') and
kwargs.get('os_password') and
kwargs.get('os_auth_url') and

View File

@ -56,7 +56,6 @@ systemconfig.puppet_plugins =
016_horizon = sysinv.puppet.horizon:HorizonPuppet
017_glance = sysinv.puppet.glance:GlancePuppet
019_cinder = sysinv.puppet.cinder:CinderPuppet
020_ceilometer = sysinv.puppet.ceilometer:CeilometerPuppet
022_heat = sysinv.puppet.heat:HeatPuppet
023_magnum = sysinv.puppet.magnum:MagnumPuppet
025_ironic = sysinv.puppet.ironic:IronicPuppet

View File

@ -1,79 +0,0 @@
#
# Copyright (c) 2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from sysinv.puppet import openstack
class CeilometerPuppet(openstack.OpenstackBasePuppet):
"""Class to encapsulate puppet operations for ceilometer configuration"""
SERVICE_NAME = 'ceilometer'
SERVICE_PORT = 8777
def get_static_config(self):
dbuser = self._get_database_username(self.SERVICE_NAME)
return {
'ceilometer::db::postgresql::user': dbuser,
}
def get_secure_static_config(self):
kspass = self._get_service_password(self.SERVICE_NAME)
return {
'ceilometer::keystone::auth::password': kspass,
'ceilometer::agent::auth::auth_password': kspass,
}
def get_system_config(self):
ksuser = self._get_service_user_name(self.SERVICE_NAME)
config = {
'ceilometer::keystone::auth::auth_name': ksuser,
'ceilometer::keystone::auth::region': self._region_name(),
'ceilometer::keystone::auth::tenant': self._get_service_tenant_name(),
'ceilometer::agent::auth::auth_url':
self._keystone_auth_uri(),
'ceilometer::agent::auth::auth_user': ksuser,
'ceilometer::agent::auth::auth_user_domain_name':
self._get_service_user_domain_name(),
'ceilometer::agent::auth::auth_project_domain_name':
self._get_service_project_domain_name(),
'ceilometer::agent::auth::auth_tenant_name':
self._get_service_tenant_name(),
'ceilometer::agent::auth::auth_region':
self._keystone_region_name(),
'openstack::ceilometer::params::region_name':
self.get_region_name(),
'openstack::ceilometer::params::service_create':
self._to_create_services(),
}
return config
def get_secure_system_config(self):
config = {
'ceilometer::db::database_connection':
self._format_database_connection(self.SERVICE_NAME),
}
return config
def get_public_url(self):
return self._format_public_endpoint(self.SERVICE_PORT)
def get_internal_url(self):
return self._format_private_endpoint(self.SERVICE_PORT)
def get_admin_url(self):
return self._format_private_endpoint(self.SERVICE_PORT)
def _get_neutron_url(self):
return self._operator.neutron.get_internal_url()
def get_region_name(self):
return self._get_service_region_name(self.SERVICE_NAME)

View File

@ -50,16 +50,11 @@ class MtcePuppet(openstack.OpenstackBasePuppet):
self._keystone_region_name(),
'platform::mtce::params::keyring_directory': KEYRING_PATH,
'platform::mtce::params::ceilometer_port':
self._get_ceilometer_port(),
'platform::mtce::params::mtce_multicast':
multicast_address.address,
}
return config
def _get_ceilometer_port(self):
return self._operator.ceilometer.SERVICE_PORT
def get_public_url(self):
# not an openstack service
raise NotImplementedError()

View File

@ -17,9 +17,6 @@
# under the License.
"""Base classes for API tests."""
# NOTE: Ported from ceilometer/tests/api.py
# https://bugs.launchpad.net/ceilometer/+bug/1193666
from oslo_config import cfg
import mock
import pecan