def show_env(): """ Shows environment variables from post deploy actions """ step_metas = get_step_metadata_filenames() print("Available environment variables: \n") table = PrettyTable() table.field_names = ["ENV", "DEFAULT", ""] table.align = 'l' for step_meta_path in step_metas: with open(step_meta_path) as fp: step_metadata = yaml.load(fp.read()) if 'additional-input' in step_metadata: for x in step_metadata['additional-input']: default = colored(x['default'], 'green', attrs=['bold']) key = colored(x['key'], 'blue', attrs=['bold']) table.add_row([ key, default, textwrap.fill(step_metadata['description'], width=55) ]) print(table) print("") url = ("https://docs.ubuntu.com/conjure-up/" "en/usage#customising-headless-mode") print( textwrap.fill( "See {} for more information on using these variables to further " "customize your deployment.".format(url), width=79)) sys.exit(0)
def __init__(self): self.view = None self.bundle_scripts = path.join(app.config['spell-dir'], 'steps') self.step_metas = common.get_step_metadata_filenames( self.bundle_scripts) self.results = OrderedDict()
def __init__(self): self.bundle_scripts = path.join( app.config['spell-dir'], 'steps' ) self.step_metas = common.get_step_metadata_filenames( self.bundle_scripts) self.results = OrderedDict()
def show_env(): """ Shows environment variables from post deploy actions """ step_scripts = os.path.join(app.config['spell-dir'], 'steps') step_metas = get_step_metadata_filenames(step_scripts) print("Available environment variables: \n") table = PrettyTable() table.field_names = ["ENV", "DEFAULT", ""] table.align = 'l' for step_meta_path in step_metas: with open(step_meta_path) as fp: step_metadata = yaml.load(fp.read()) if 'additional-input' in step_metadata: for x in step_metadata['additional-input']: default = colored(x['default'], 'green', attrs=['bold']) key = colored(x['key'], 'blue', attrs=['bold']) table.add_row([ key, default, textwrap.fill(step_metadata['description'], width=55) ]) print(table) print("") print( textwrap.fill( "See http://conjure-up.io/docs/en/users/#running-in-headless-mode " "for more information on using these variables to further " "customize your deployment.", width=79)) sys.exit(0)
def show_env(): """ Shows environment variables from post deploy actions """ step_scripts = os.path.join( app.config['spell-dir'], 'steps' ) step_metas = get_step_metadata_filenames(step_scripts) print("Available environment variables: \n") table = PrettyTable() table.field_names = ["ENV", "DEFAULT", ""] table.align = 'l' for step_meta_path in step_metas: with open(step_meta_path) as fp: step_metadata = yaml.load(fp.read()) if 'additional-input' in step_metadata: for x in step_metadata['additional-input']: default = colored(x['default'], 'green', attrs=['bold']) key = colored(x['key'], 'blue', attrs=['bold']) table.add_row([key, default, textwrap.fill(step_metadata['description'], width=55)]) print(table) print("") print( textwrap.fill( "See http://conjure-up.io/docs/en/users/#running-in-headless-mode " "for more information on using these variables to further " "customize your deployment.", width=79)) sys.exit(0)
async def do_steps(self): step_metas = common.get_step_metadata_filenames() results = OrderedDict() for step_meta_path in step_metas: step_model = common.load_step(step_meta_path) if utils.is_linux(): if step_model.needs_sudo and not utils.can_sudo(): utils.error("Step requires passwordless sudo: {}".format( step_model.title)) events.Shutdown.set(1) return results[step_model.title] = await common.do_step(step_model, utils.info) events.PostDeployComplete.set() return controllers.use('summary').render(results)
def __init__(self): self.view = None self.step_metas = common.get_step_metadata_filenames() self.results = OrderedDict() self.step_queue = utils.IterQueue()