Execute a command (after the --) as an assumed role (specified by --artifact)
546078
def execute_as(collector):
    """"""
    # Gonna assume role anyway...
    collector.configuration['amazon']._validated = True

    # Find the arn we want to assume
    account_id = collector.configuration['accounts'][collector.configuration['aws_syncr'].environment]
    arn = "arn:aws:iam::{0}:role/{1}".format(account_id, collector.configuration['aws_syncr'].artifact)

    # Determine the command to run
    parts = shlex.split(collector.configuration["aws_syncr"].extra)
    if not parts:
        suggestion = " ".join(sys.argv) + " -- /path/to/command_to_run"
        msg = "No command was provided. Try something like:\n\t\t{0}".format(suggestion)
        raise AwsSyncrError(msg)

    # Get our aws credentials environment variables from the assumed role
    env = dict(os.environ)
    env.update(collector.configuration['amazon'].iam.assume_role_credentials(arn))

    # Turn into the command we want to execute
    os.execvpe(parts[0], parts, env)
613547
def role(ctx, dependency_name, driver_name, lint_name, provisioner_name,
         role_name, verifier_name, template):  # pragma: no cover
    
    command_args = {
        'dependency_name': dependency_name,
        'driver_name': driver_name,
        'lint_name': lint_name,
        'provisioner_name': provisioner_name,
        'role_name': role_name,
        'scenario_name': command_base.MOLECULE_DEFAULT_SCENARIO_NAME,
        'subcommand': __name__,
        'verifier_name': verifier_name,
    }

    if verifier_name == 'inspec':
        command_args['verifier_lint_name'] = 'rubocop'

    if verifier_name == 'goss':
        command_args['verifier_lint_name'] = 'yamllint'

    if verifier_name == 'ansible':
        command_args['verifier_lint_name'] = 'ansible-lint'

    if template is not None:
        command_args['template'] = template

    r = Role(command_args)
    r.execute()
351739
def exec(self, *command_tokens, **command_env):
		
		if self.match(*command_tokens, **command_env) is False:
			raise RuntimeError('Command mismatch: %s' % self.join_tokens(*command_tokens))

		return self._exec(*command_tokens, **command_env)
1047041
def execute(self, *args, **kwargs):
        
        # Remove internal Django command handling machinery
        kwargs.pop('skip_checks', None)
        parent_ctx = click.get_current_context(silent=True)
        with self.make_context('', list(args), parent=parent_ctx) as ctx:
            # Rename kwargs to to the appropriate destination argument name
            opt_mapping = dict(self.map_names())
            arg_options = {opt_mapping.get(key, key): value
                           for key, value in six.iteritems(kwargs)}

            # Update the context with the passed (renamed) kwargs
            ctx.params.update(arg_options)

            # Invoke the command
            self.invoke(ctx)
275535
def exec(self, *command_tokens, command_context=None, **command_env):
		
		if self.adapter().match(command_context, **command_env) is False:
			cmd = WCommandProto.join_tokens(*command_tokens)
			spec = self.adapter().specification()
			if spec is not None:
				spec = [x.context_name() for x in spec]
				spec.reverse()
				spec = ','.join(spec)
			raise RuntimeError('Command mismatch: %s (context: %s)' % (cmd, spec))

		command_tokens = self.adapter().adapt(*command_tokens, command_context=command_context, **command_env)
		return self.original_command().exec(*command_tokens, command_context=command_context, **command_env)
341248
def exec(self, *command_tokens, **command_env):
		
		mutated_command_tokens = self.mutate_command_tokens(*command_tokens)
		if mutated_command_tokens is not None:
			command = self.selector().select(*mutated_command_tokens, **command_env)
			if command is not None:
				return command.exec(*mutated_command_tokens, **command_env)

		raise RuntimeError('Command mismatch: %s' % self.join_tokens(*command_tokens))
308064
def do_command(self):
        """"""
        method = self.args[0]

        raw_args = self.args[1:]
        if '=' in method:
            if raw_args:
                self.parser.error("Please don't mix rTorrent and shell argument styles!")
            method, raw_args = method.split('=', 1)
            raw_args = raw_args.split(',')

        self.execute(self.open(), method, self.cooked(raw_args))
230208
function execute(log, command, opt_callback) {
  if (!registry[command]) {
    registry[command] = new Executable(log, command)
  }

  var executable = registry[command]
  if (opt_callback) executable.addCallback(opt_callback)
}
515530
def _handle_shell(self,cfg_file,*args,**options):
        """"""
        args = ("--interactive",) + args
        return supervisorctl.main(("-c",cfg_file) + args)
1306117
def dispatch_command(self, command, params=None):
        """"""
        try:
            if command in self.handlers:
                self.handlers[command](**params)
            else:
                logging.warning('Unsupported command: %s: %s',
                                command, params)
        except Exception as e:
            logging.warning('Error during command execution',
                            exc_info=sys.exc_info())
            raise e
526875
def execute(command, silent = false, &block)
      result = run_with_timeout(command)
      if result.success? or silent
        warn command if @verbose
        return result unless block
        return block.call(result)
      end
      raise Error, cmd_error_message(command, result.data)
    rescue Errno::ENOENT
      raise Error, cmd_error_message(command, $!.message)
    end
1001413
def execute(node, arguments)
      full_command = construct_full_command(node, arguments)
      begin
        puts "\n(external) > #{full_command}".bc_blue + "\n\n"
        system(full_command)
      rescue Interrupt
        puts "\nExiting gracefully from interrupt\n".warning
      end
    end
47303
def execute(self, argv=None):
        
        if self.completion:
            self.autocomplete()
        parser = self.get_parser()
        namespace = parser.parse_args(argv)
        if hasattr(namespace, 'func'):
            self.run_command(namespace)
995595
def execute_command(command=None):
    """"""
    process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout, stdin = process.communicate()
    process.wait()
    return (stdout, stdin), process.returncode
1187834
def execute_command(self, request, command, frame):
        """"""
        return Response(frame.console.eval(command), mimetype="text/html")
1171962
def execute(cls, command, shell=True):
        
        cls.debug('execute command (shell flag:%r): %r ' % (shell, command))
        try:
            check_call(command, shell=shell)
            return True
        except CalledProcessError:
            return False
1093772
def execute(self, processProtocol, command, env={},
                path=None, uid=None, gid=None, usePTY=0, childFDs=None):
        
        raise NotImplementedError()