Fix mysql instance create failed when enable skip-name-resolve

In the guestagent code, it create os_admin user only grant
privileges on host:localhost, but use host:127.0.0.1 to
connect to mysql. Modify host privileges grant on to 127.0.0.1
to avoid create instance failed when enable skip-name-resolve
in config file.

Change-Id: Ifa69461c8a55464f88aec001d067450eedccf172
Closes-bug: #1729225
(cherry picked from commit 43c545ac84)
This commit is contained in:
chengyang 2017-11-02 22:41:08 +08:00
parent e6d4b4b3fe
commit d45716a9fe
1 changed files with 2 additions and 2 deletions

View File

@ -657,9 +657,9 @@ class BaseMySqlApp(object):
with all privileges similar to the root user.
"""
LOG.debug("Creating Trove admin user '%s'.", ADMIN_USER_NAME)
localhost = "localhost"
host = "127.0.0.1"
g = sql_query.Grant(permissions='ALL', user=ADMIN_USER_NAME,
host=localhost, grant_option=True, clear=password)
host=host, grant_option=True, clear=password)
t = text(str(g))
client.execute(t)
LOG.debug("Trove admin user '%s' created.", ADMIN_USER_NAME)