Reviewed: https://review.openstack.org/471487 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9a33092fa9b0c65b37b9fdc860f5a571908d7a69 Submitter: Jenkins Branch: master
commit 9a33092fa9b0c65b37b9fdc860f5a571908d7a69 Author: Sylvain Bauza <sba...@redhat.com> Date: Tue Jun 6 23:28:59 2017 +0200 Fix cell0 naming when QS params on the connection We had a problem when the nova connection string included parameters on the query string like charset encoding. Note that the connection string necessarly needs to be RFC1738 compliant as per Sqlalchemy rules, so it's totally safe to just unquote what the SQLA helper method gives us as a result. Also removed a tested connection string since it wasn't RFC1738 compatible. Change-Id: I45fe9b92e8d93a0099d33bb0070e9d4e540595ac Closes-Bug: #1696001 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1696001 Title: nova-manage cell_v2 map_cell0 can create invalid connection URL Status in OpenStack Compute (nova): Fix Released Status in OpenStack Compute (nova) newton series: In Progress Status in OpenStack Compute (nova) ocata series: In Progress Bug description: Description =========== nova-manage cell_v2 map_cell0 will automatically generate a database connection url from the existing connection configuration setting. However, if the connection has query parameters like a charset defined, it will generate an invalid URL. Steps to reproduce ================== Set the following in the nova.conf: [database] connection = mysql+pymysql://nova:passw...@db.example.com/nova?charset=utf8 Run: nova-manage cell_v2 map_cell0 Excepted result =============== Cell0 is mapped to mysql+pymysql://nova:passw...@db.example.com/nova_cell0?charset=utf8 Actual Result ============= Cell0 is mapped to mysql+pymysql://nova:passw...@db.example.com/nova?charset=utf8nova_cell0 Subsequent API calls may fail because of this with exceptions like: 2017-06-05 20:54:20.343 2197 ERROR nova.api.openstack.extensions File "/usr/lib/python2.7/dist-packages/pymysql/connections.py", line 660, in __init__ 2017-06-05 20:54:20.343 2197 ERROR nova.api.openstack.extensions self.encoding = charset_by_name(self.charset).encoding 2017-06-05 20:54:20.343 2197 ERROR nova.api.openstack.extensions AttributeError: 'NoneType' object has no attribute 'encoding' because utf8nova_cell0 is not a valid encoding. Environment: OpenStack Ocata, # dpkg -l | grep nova-common ii nova-common 2:15.0.5-1~u16.04+mcp5 all OpenStack Compute - common files To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1696001/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp