def main(): """Main function for invoking the bootstrap process remotely """ # Get the commandline arguments opts = get_opts() from bootstrapvz.common.tools import load_data # load the manifest data, we might want to modify it later on manifest_data = load_data(opts['MANIFEST']) # load the build servers file build_servers = load_data(opts['--servers']) # Pick a build server from build_servers import pick_build_server preferences = {} if opts['--name'] is not None: preferences['name'] = opts['--name'] if opts['--release'] is not None: preferences['release'] = opts['--release'] build_server = pick_build_server(build_servers, manifest_data, preferences) # Apply the build server settings to the manifest (e.g. the virtualbox guest additions path) manifest_data = build_server.apply_build_settings(manifest_data) # Load the manifest from bootstrapvz.base.manifest import Manifest manifest = Manifest(path=opts['MANIFEST'], data=manifest_data) # Set up logging from bootstrapvz.base.main import setup_loggers setup_loggers(opts) # Register deserialization handlers for objects # that will pass between server and client from . import register_deserialization_handlers register_deserialization_handlers() # Everything has been set up, connect to the server and begin the bootstrapping process with build_server.connect() as connection: connection.run(manifest, debug=opts['--debug'], dry_run=opts['--dry-run'])
shutil.move("bootstrap-vz/bootstrapvz", "bootstrapvz") from bootstrapvz.base.main import run, setup_loggers from bootstrapvz.base.manifest import Manifest import bootstrapvz.base.log options = {'MANIFEST': 'unstable.json', '--debug': True, '--dry-run': False, '--help': False, '--pause-on-error': False, '--log': '/var/log/bootstrap-vz'} if not os.path.exists(options['--log']): os.makedirs(options['--log']) setup_loggers(options) manifest_data = { "provider": { "name": "ec2", "virtualization": "pvm" }, "bootstrapper": { "workspace": "/target" }, "image": { "name": "test-{system.release}-{system.architecture}-{provider.virtualization}-{%Y}-{%m}-{%d}-{%H}-{%M}-ebs", "description": "Test {system.release} {system.architecture}" }, "system": { "release": "unstable",