diff --git a/clearstack/modules/ceilometer.py b/clearstack/modules/ceilometer.py index ddf5fde..087e8b6 100644 --- a/clearstack/modules/ceilometer.py +++ b/clearstack/modules/ceilometer.py @@ -17,8 +17,6 @@ # limitations under the License. # -import socket - from modules.keystone import Keystone from modules.openstack import OpenStackService from modules.conf import CONF @@ -39,7 +37,7 @@ class Ceilometer(OpenStackService): def config_database(self, configfile): dbpass = CONF['CONFIG_%s_DB_PW' % self._name.upper()] - dbhost = socket.gethostbyaddr(CONF['CONFIG_MONGODB_HOST'])[0] + dbhost = CONF['CONFIG_MONGODB_HOST'] config = ("[database]\n" "connection=mongodb://{0}:{1}@{2}:27017/{0}" .format(self._name, dbpass, dbhost)) diff --git a/clearstack/modules/mariadb.py b/clearstack/modules/mariadb.py index 73c1b22..be424a4 100644 --- a/clearstack/modules/mariadb.py +++ b/clearstack/modules/mariadb.py @@ -89,7 +89,7 @@ class MariaDB: " the password is incorrect") return sys.exit(1) - def setup_database(self, database, user, password, host): + def setup_database(self, database, user, password): LOG.debug("setting up database") mariadb_user = CONF["CONFIG_MARIADB_USER"] mariadb_pw = CONF["CONFIG_MARIADB_PW"] diff --git a/clearstack/modules/openstack.py b/clearstack/modules/openstack.py index 7173e0b..be60c17 100644 --- a/clearstack/modules/openstack.py +++ b/clearstack/modules/openstack.py @@ -18,8 +18,6 @@ # limitations under the License. # -import socket - from common import util from common.swupd import Client as swupd_client from common.util import LOG @@ -33,7 +31,7 @@ class OpenStackService: _admin_url = "" _region = "" _user = "" - _controller = socket.gethostbyaddr(CONF["CONFIG_CONTROLLER_HOST"])[0] + _controller = CONF["CONFIG_CONTROLLER_HOST"] _password = "" def __init__(self): @@ -160,14 +158,14 @@ class OpenStackService: def config_database(self, configfile): dbpass = CONF['CONFIG_%s_DB_PW' % self._name.upper()] - dbhost = socket.gethostbyaddr(CONF['CONFIG_MARIADB_HOST'])[0] + dbhost = CONF['CONFIG_MARIADB_HOST'] config = ("[database]\n" "connection=mysql://{0}:{1}@{2}/{0}" .format(self._name, dbpass, dbhost)) util.write_config(configfile, config) def config_rabbitmq(self, configfile): - rabbit_host = socket.gethostbyaddr(CONF['CONFIG_AMQP_HOST'])[0] + rabbit_host = CONF['CONFIG_AMQP_HOST'] rabbit_password = CONF['CONFIG_AMQP_AUTH_PASSWORD'] rabbit_user = CONF['CONFIG_AMQP_AUTH_USER'] config = \ diff --git a/clearstack/templates/mariadb.py b/clearstack/templates/mariadb.py index edf3c58..3108ea5 100644 --- a/clearstack/templates/mariadb.py +++ b/clearstack/templates/mariadb.py @@ -17,8 +17,6 @@ # limitations under the License. # -import socket - from common.util import LOG from common import util from modules.conf import CONF @@ -28,7 +26,6 @@ conf = CONF mariadb = MariaDB.get() mariadb_user = CONF["CONFIG_MARIADB_USER"] mariadb_pw = CONF["CONFIG_MARIADB_PW"] -controller = socket.gethostbyaddr(CONF["CONFIG_CONTROLLER_HOST"])[0] if util.str2bool(conf['CONFIG_MARIADB_INSTALL']): mariadb.install() @@ -43,4 +40,4 @@ for database in databases: % database.upper()]): LOG.info("Setting up mariadb for %s" % database) password = CONF['CONFIG_%s_DB_PW' % database.upper()] - mariadb.setup_database(database, database, password, controller) + mariadb.setup_database(database, database, password)