From 538721d3fdab613ed3d3ab33df123f90da173e93 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 18 Feb 2013 11:04:56 -0500 Subject: Make update.py work with oslo.config As we move modules out of openstack.common into the oslo namespace package, we need to prevent update.py from breaking any import statements using them. Rather than build a super complicated regex to only detect the proper instances of "oslo" to replace in places like the defaults for option settings, just do the simple translation between oslo -> base and then go back and fix the modules we know have been moved. Change-Id: I9686b94b4c7df8542964b30ba15f0a91d2b3d722 Signed-off-by: Doug Hellmann --- update.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'update.py') diff --git a/update.py b/update.py index 5a19989..24f1a53 100644 --- a/update.py +++ b/update.py @@ -134,6 +134,15 @@ def _copy_file(path, dest, base): _replace(dest, 'oslo', base) + # Restore the imports for modules that are part of the oslo + # namespace package. We can't just do something like 'oslo\..+' + # because there are default configuration settings like + # "oslo.sqlite" that we want to have changed to "nova.sqlite" by + # the above call. + for oslo_module in ['config']: + _replace(dest, base + '.' + oslo_module, + 'oslo.' + oslo_module) + _replace(dest, '^( *)from openstack.common', r'\1from ' + base + '.openstack.common') -- cgit