def cmd(stackname, command=None, username=DEPLOY_USER, clean_output=False, concurrency=None, node=None): if command is None: abort("Please specify a command e.g. ./bldr cmd:%s,ls" % stackname) LOG.info("Connecting to: %s", stackname) instances = _check_want_to_be_running(stackname) if not instances: return # take out the load of crap that Fabric prints mangling the useful output # of a remote command custom_settings = {} if clean_output: fabric.state.output['status'] = False fabric.state.output['running'] = False custom_settings['output_prefix'] = False try: with settings(**custom_settings): return stack_all_ec2_nodes( stackname, (run, {'command': command}), username=username, abort_on_prompts=True, concurrency=concurrency_for(stackname, concurrency), node=int(node) if node else None ) except FabricException as e: LOG.error(e) exit(2)
def cmd(stackname, command=None, username=DEPLOY_USER, clean_output=False, concurrency=None, node=None): if command is None: utils.errcho("Please specify a command e.g. ./bldr cmd:%s,ls" % stackname) exit(1) LOG.info("Connecting to: %s", stackname) instances = _check_want_to_be_running(stackname) if not instances: return # take out the load of crap that Fabric prints mangling the useful output # of a remote command custom_settings = {} if clean_output: custom_settings['fabric.state.output'] = { 'status': False, 'running': False } custom_settings['output_prefix'] = False try: with settings(**custom_settings): return stack_all_ec2_nodes( stackname, (remote, {'command': command}), username=username, abort_on_prompts=True, concurrency=concurrency_for(stackname, concurrency), node=int(node) if node else None ) except CommandException as e: LOG.error(e) exit(2)
def switch_revision_update_instance(stackname, revision=None, concurrency='serial'): buildvars.switch_revision(stackname, revision) bootstrap.update_stack(stackname, service_list=['ec2'], concurrency=concurrency_for(stackname, concurrency))
def switch_revision_update_instance(stackname, revision=None, concurrency='serial'): "changes the revision of the stack's project and then calls highstate." buildvars.switch_revision(stackname, revision) bootstrap.update_stack(stackname, service_list=['ec2'], concurrency=concurrency_for(stackname, concurrency))