From 4cd94cd7633eb18c6928eef6ad3db1ac4ed4d406 Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Fri, 19 Jul 2013 15:30:49 +0800 Subject: Fix issues syncing sample generator in update.py When updating the openstack.common.config module, the shutil module raises an exception when attemting to copy a directory. Fixed to skip directories as copy targets and handle directories of target module names. Fixed problem of wrong import path of the generator module. Change-Id: Ie8336b070573c74691ab5e7304dd05c540826c53 --- update.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/update.py b/update.py index 2edc8ef..a9c71ba 100644 --- a/update.py +++ b/update.py @@ -166,6 +166,10 @@ def _copy_file(path, dest, base): '\"openstack\.common', '\"' + base + '.openstack.common') + _replace(dest, + '=openstack\.common', + '=' + base + '.openstack.common') + _replace(dest, 'possible_topdir, "oslo",$', 'possible_topdir, "' + base + '",') @@ -201,13 +205,14 @@ def _copy_module(mod, base, dest_dir): copy_pyfile(os.path.join(mod_path, s)) globs_to_copy = [ + os.path.join('tools', mod, '*.sh'), os.path.join('tools', mod + '*'), os.path.join('etc', 'oslo', mod + '*.conf'), os.path.join('contrib', mod + '*'), ] for matches in [glob.glob(g) for g in globs_to_copy]: - for match in matches: + for match in [x for x in matches if not os.path.isdir(x)]: dest = os.path.join(dest_dir, match.replace('oslo', base)) print("Copying %s to %s" % (match, dest)) _copy_file(match, dest, base) -- cgit