-import os
-import shutil
-import logging
-import errno
import sys
+import os.path
-import wizard
-from wizard import command, deploy, shell, util
+from wizard import command, deploy, shell
def main(argv, baton):
options, args = parse_args(argv, baton)
- sh = shell.Shell()
- d = deploy.Deployment(".")
- try:
- configure_args = args + command.make_base_args(options)
- sh.call("wizard", "configure", *configure_args, interactive=True)
- except shell.PythonCallError:
- sys.exit(1)
- d.prepareConfig()
+ wc = deploy.WorkingCopy(".")
+ wc.verify()
+ wc.verifyConfigured()
+ # worst case scenario protection
+ for file in wc.application.parametrized_files:
+ shell.call("git", "add", file)
+ shell.call("git", "commit", "--allow-empty", "-am", "Protection commit")
+ shell.call("git", "reset", "HEAD~")
+ wc.prepareConfig()
def parse_args(argv, baton):
- usage = """usage: %prog prepare-config -- [SETUPARGS]
+ usage = """usage: %prog prepare-config
During the preparation of an upgrade, changes to configuration files
must be taken into account. Unfortunately, configuration files
are not commonly versioned, and are commonly autogenerated. Running
this command will update all configuration files.
-To be more specific, it takes a checked out repository, and performs a
-configuration. Then, it replaces the specific values from the installation
+To be more specific, it replaces the specific values from the installation
back with generic values, which can be committed to the repository. The final
working copy state has HEAD pointing to the -scripts version that the commit
was based off of, but with local changes that can be incorporated using