diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2015-07-20 19:15:50 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2015-07-20 20:02:54 +0200 |
commit | 061640050936bd35e1d21aa44bc47237cca9a0f4 (patch) | |
tree | 2763f004a27f4482d8e2c9938307c0c6c26b40bd /tools | |
parent | 33e53dde2a85b8783c8e4935868d9c5f50dea440 (diff) | |
download | bcfg2-061640050936bd35e1d21aa44bc47237cca9a0f4.tar.gz bcfg2-061640050936bd35e1d21aa44bc47237cca9a0f4.tar.bz2 bcfg2-061640050936bd35e1d21aa44bc47237cca9a0f4.zip |
tools: Fix issue introduced in cd14868d with new parser for Options
The new parser creates the the full plugin classes out of the options,
so we need to use the __name__ attribute to get the name of the plugin
and the directory containing the files in the repository.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/upgrade/1.3/migrate_info.py | 6 | ||||
-rwxr-xr-x | tools/upgrade/1.3/migrate_perms_to_mode.py | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/tools/upgrade/1.3/migrate_info.py b/tools/upgrade/1.3/migrate_info.py index 7f3bb9a29..2f8035bcd 100755 --- a/tools/upgrade/1.3/migrate_info.py +++ b/tools/upgrade/1.3/migrate_info.py @@ -48,9 +48,11 @@ def main(): parser.parse() for plugin in Bcfg2.Options.setup.plugins: - if plugin not in ['SSLCA', 'Cfg', 'TGenshi', 'TCheetah', 'SSHbase']: + plugin_name = plugin.__name__ + if plugin_name not in ['SSLCA', 'Cfg', 'TGenshi', 'TCheetah', + 'SSHbase']: continue - datastore = os.path.join(Bcfg2.Options.setup.repository, plugin) + datastore = os.path.join(Bcfg2.Options.setup.repository, plugin_name) for root, dirs, files in os.walk(datastore): for fname in files: if fname in [":info", "info"]: diff --git a/tools/upgrade/1.3/migrate_perms_to_mode.py b/tools/upgrade/1.3/migrate_perms_to_mode.py index 2dfb70388..42fe2e1a8 100755 --- a/tools/upgrade/1.3/migrate_perms_to_mode.py +++ b/tools/upgrade/1.3/migrate_perms_to_mode.py @@ -71,17 +71,19 @@ def main(): repo = Bcfg2.Options.setup.repository for plugin in Bcfg2.Options.setup.plugins: - if plugin in ['Base', 'Bundler', 'Rules']: - for root, _, files in os.walk(os.path.join(repo, plugin)): + plugin_name = plugin.__name__ + if plugin_name in ['Base', 'Bundler', 'Rules']: + for root, _, files in os.walk(os.path.join(repo, plugin_name)): if skip_path(root): continue for fname in files: if skip_path(fname): continue convertstructure(os.path.join(root, fname)) - if plugin not in ['Cfg', 'TGenshi', 'TCheetah', 'SSHbase', 'SSLCA']: + if plugin_name not in ['Cfg', 'TGenshi', 'TCheetah', 'SSHbase', + 'SSLCA']: continue - for root, dirs, files in os.walk(os.path.join(repo, plugin)): + for root, dirs, files in os.walk(os.path.join(repo, plugin_name)): if skip_path(root): continue for fname in files: |