summaryrefslogtreecommitdiffstats
path: root/tools/upgrade/1.3/migrate_perms_to_mode.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-06-27 10:36:17 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-06-27 10:42:32 -0400
commitcd14868d4db8eaa7e9421e1d5fe8653294ac1e38 (patch)
tree52ad2955c9d81a979d5242262a0209eafd3a12d4 /tools/upgrade/1.3/migrate_perms_to_mode.py
parent02783685f003b740b2ced28566833a46d3da07f1 (diff)
downloadbcfg2-cd14868d4db8eaa7e9421e1d5fe8653294ac1e38.tar.gz
bcfg2-cd14868d4db8eaa7e9421e1d5fe8653294ac1e38.tar.bz2
bcfg2-cd14868d4db8eaa7e9421e1d5fe8653294ac1e38.zip
Options: migrated tools to new parser
Diffstat (limited to 'tools/upgrade/1.3/migrate_perms_to_mode.py')
-rwxr-xr-xtools/upgrade/1.3/migrate_perms_to_mode.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/upgrade/1.3/migrate_perms_to_mode.py b/tools/upgrade/1.3/migrate_perms_to_mode.py
index 18abffec2..786df0de6 100755
--- a/tools/upgrade/1.3/migrate_perms_to_mode.py
+++ b/tools/upgrade/1.3/migrate_perms_to_mode.py
@@ -54,16 +54,17 @@ def convertstructure(structfile):
def main():
- opts = dict(repo=Bcfg2.Options.SERVER_REPOSITORY,
- configfile=Bcfg2.Options.CFILE,
- plugins=Bcfg2.Options.SERVER_PLUGINS)
- setup = Bcfg2.Options.OptionParser(opts)
- setup.parse(sys.argv[1:])
- repo = setup['repo']
+ parser = Bcfg2.Options.get_parser(
+ description="Migrate from Bcfg2 1.2 'perms' attribute to 1.3 'mode' "
+ "attribute")
+ parser.add_options([Bcfg2.Options.Common.repository,
+ Bcfg2.Options.Common.plugins])
+ parser.parse()
+ repo = Bcfg2.Options.setup.repository
- for plugin in setup['plugins']:
+ for plugin in Bcfg2.Options.setup.plugins:
if plugin in ['Base', 'Bundler', 'Rules']:
- for root, dirs, files in os.walk(os.path.join(repo, plugin)):
+ for root, _, files in os.walk(os.path.join(repo, plugin)):
for fname in files:
convertstructure(os.path.join(root, fname))
if plugin not in ['Cfg', 'TGenshi', 'TCheetah', 'SSHbase', 'SSLCA']: