Do not translate ip address to hostname

- Sometimes when translating ip address to hostname, the hostnames
  do not resolve back to the original ip.
This commit is contained in:
Alberto Murillo
2016-01-18 10:15:32 -06:00
parent 6f1e672d20
commit a743466c78
4 changed files with 6 additions and 13 deletions
+1 -3
View File
@@ -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))
+1 -1
View File
@@ -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"]
+3 -5
View File
@@ -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 = \
+1 -4
View File
@@ -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)