diff options
author | Rick Harris <rconradharris@gmail.com> | 2012-03-28 21:45:21 +0000 |
---|---|---|
committer | Rick Harris <rconradharris@gmail.com> | 2012-03-28 21:45:21 +0000 |
commit | 95c4f5ab1159d69a73c41ba5f4f4a845fe22cc16 (patch) | |
tree | 36cc53bd38b137dc0ff7e07f00dd43abe254587f /update.py | |
parent | 8c0f7dc0702f3e9a0e198a6206ecd2f0f8cc6d62 (diff) | |
download | oslo-95c4f5ab1159d69a73c41ba5f4f4a845fe22cc16.tar.gz oslo-95c4f5ab1159d69a73c41ba5f4f4a845fe22cc16.tar.xz oslo-95c4f5ab1159d69a73c41ba5f4f4a845fe22cc16.zip |
Create openstack/common/__init__.py
Fixes bug 967808
Change-Id: Ic4c1fc5520cb96f40b6ed87bfff024906f983235
Diffstat (limited to 'update.py')
-rw-r--r-- | update.py | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -165,6 +165,20 @@ def _copy_module(mod, base, dest_dir): _copy_file(_mod_to_path('openstack.common.' + mod) + '.py', base, dest_dir) +def _create_module_init(base, dest_dir, *sub_paths): + """Create module __init__ files.""" + init_path = _dest_path('openstack', base, dest_dir) + + if sub_paths: + init_path = os.path.join(init_path, *sub_paths) + + init_path = os.path.join(init_path, '__init__.py') + + if not os.path.exists(init_path): + _make_dirs(init_path) + open(init_path, 'w').close() + + def main(argv): conf = _parse_args(argv) @@ -184,11 +198,8 @@ def main(argv): print >> sys.stderr, "A destination base module is required" sys.exit(1) - init_path = os.path.join(_dest_path('openstack', conf.base, dest_dir), - '__init__.py') - if not os.path.exists(init_path): - _make_dirs(init_path) - open(init_path, 'w').close() + _create_module_init(conf.base, dest_dir) + _create_module_init(conf.base, dest_dir, 'common') for mod in conf.modules: _copy_module(mod, conf.base, dest_dir) |