Executes vagrant command which means that arguments passed here will be prepended with "vagrant"
@param vagrantCommand arguments for <i>vagrant</i> command
@return vagrant response object
353007
public CommandResponse doVagrant(String vagrantVm, final String... vagrantCommand) {
        CommandResponse response = commandProcessor.run(
                aCommand("vagrant").withArguments(vagrantCommand).withOptions(vagrantVm)
        );

        if(!response.isSuccessful()) {
            throw new RuntimeException("Errors during vagrant execution: \n" + response.getErrors());
        }

        // Check for puppet errors. Not vagrant still returns 0 when puppet fails
        // May not be needed after this PR released: https://github.com/mitchellh/vagrant/pull/1175
        for (String line : response.getOutput().split("\n\u001B")) {
            if (line.startsWith("[1;35merr:")) {
                throw new RuntimeException("Error in puppet output: " + line);
            }
        }

        return response;
    }
237776
def write(self, cmd_args):
	
		
		
		args = [
			"vagrant"
		]
		args.extend(cmd_args)
		subprocess.call(args)
490287
def provision(self, vm_name=None, provision_with=None):
        '''
        
        '''
        prov_with_arg = None if provision_with is None else '--provision-with'
        providers_arg = None if provision_with is None else ','.join(provision_with)
        self._call_vagrant_command(['provision', vm_name, prov_with_arg,
                                   providers_arg])
177735
public int dispatchCommand(Object pVm,VirtualMachineHandler pHandler) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException {
        String commandName = options.getCommand();
        AbstractBaseCommand command = COMMANDS.get(commandName);
        if (command == null) {
            throw new IllegalArgumentException("Unknown command '" + commandName + "'");
        }
        return command.execute(options,pVm,pHandler);
    }
998116
def vagrant(dir = Dir.pwd, options = {})
      info "Initialize Vagrant (see https://www.vagrantup.com/)"
      path = normalized_path(dir)
      use_git = FalkorLib::Git.init?(path)
      rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path
      templatedir = File.join( FalkorLib.templates, 'vagrant')
      config = FalkorLib::Config::Bootstrap::DEFAULTS[:vagrant].clone
      if options[:os]
        config[:os] = options[:os]
      else
        config[:os] = select_from(config[:boxes].keys,
                    "Select OS to configure within your vagrant boxes by default",
                    (config[:boxes].keys.find_index(config[:os]) + 1))
      end
      [ :ram, :vcpus, :domain, :range ].each do |k|
        config[k.to_sym] = ask("\tDefault #{k.capitalize}:", config[k.to_sym])
      end
      puts config.to_yaml
      FalkorLib::GitFlow.start('feature', 'vagrant', rootdir) if (use_git && FalkorLib::GitFlow.init?(rootdir))
      init_from_template(templatedir, rootdir, config,
                         :no_interaction => true,
                         :no_commit => true)
      [ 'bootstrap.sh', 'config.yaml.sample' ].each do |f|
        FalkorLib::Git.add(File.join(rootdir, 'vagrant', "#{f}")) if use_git
      end
      Dir.chdir( rootdir ) do
        run %(git ignore '.vagrant/' )
        #   run %(ln -s README.md index.md )
      #   run %(ln -s README.md contributing/index.md )
      #   run %(ln -s README.md setup/index.md )
      end
      FalkorLib::Git.add(File.join(rootdir, '.gitignore')) if use_git

      #exit_status.to_i
    end
268815
public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();

            // declare parameters
            String url = null;

            // parse command-line input
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

            // check required options and/or conflicting options
            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_URL);

            // load parameters
            url = (String) options.valueOf(AdminParserUtils.OPT_URL);

            // execute command
            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            doMetaCheckVersion(adminClient);
        }
743391
@SuppressWarnings("unchecked")
    @Override
    public Boolean execute() {
        validateCommand();
        Room room = CommandUtil.getSfsRoom(roomName, extension);
        validateRoom(room);
        List<User> recipients = room.getUserList();
        for(String exUser : excludedUsers) 
            recipients.remove(room.getUserByName(exUser));
        ISFSObject params = createResponseParams();
        api.sendExtensionResponse(command, params, recipients, room, useUDP);
        logResponse(params);
        return Boolean.TRUE;
    }
327952
public static void executeCommand(String[] args) throws Exception {
        String subCmd = (args.length > 0) ? args[0] : "";
        args = AdminToolUtils.copyArrayCutFirst(args);
        if(subCmd.equals("native-backup")) {
            SubCommandNativeBackup.executeCommand(args);
        } else if(subCmd.equals("restore-from-replica")) {
            SubCommandRestoreFromReplica.executeCommand(args);
        } else {
            AdminCommand.printHelp(System.out);
        }
    }
1137549
def command(cmd, params = {}, options = '')
      flood_control

      out = ''
      response = ''

      out += cmd

      params.each_pair do |key, value|
        out += " #{key}=#{encode_param(value.to_s)}"
      end

      out += ' ' + options

      @sock.puts out

      if cmd == 'servernotifyregister'
        2.times { response += @sock.gets }
        return parse_response(response)
      end

      loop do
        response += @sock.gets

        break if response.index(' msg=')
      end

      # Array of commands that are expected to return as an array.
      # Not sure - clientgetids
      should_be_array = %w(
        bindinglist serverlist servergrouplist servergroupclientlist
        servergroupsbyclientid servergroupclientlist logview channellist
        channelfind channelgrouplist channelgroupclientlist channelgrouppermlist
        channelpermlist clientlist clientfind clientdblist clientdbfind
        channelclientpermlist permissionlist permoverview privilegekeylist
        messagelist complainlist banlist ftlist custominfo permfind
      )

      parsed_response = parse_response(response)

      should_be_array.include?(cmd) ? parsed_response : parsed_response.first
    end
743603
@Override
    public int executeCommand(final IndexCommand command) throws IndexingException {
        LOGGER.trace("executeCommand() called...");

        // Execute and return the result...
        return executeCommand(serverDetails, command);
    }
364074
@Override
	public Response executeCommand( String app, String commandName ) {

		this.logger.fine("Request: execute command " + commandName + " in the " + app + " application.");
		String lang = lang( this.manager );
		Response response = Response.ok().build();
		try {
			Application application = this.manager.applicationMngr().findApplicationByName( app );
			if( application == null )
				response = handleError( Status.NOT_FOUND, new RestError( REST_INEXISTING, application( app )), lang ).build();
			else
				this.manager.commandsMngr().execute( application, commandName, CommandHistoryItem.ORIGIN_REST_API, null );

		} catch( NoSuchFileException e ) {
			response = RestServicesUtils.handleError(
					Status.NOT_FOUND,
					new RestError( ErrorCode.REST_INEXISTING, e, ErrorDetails.name( commandName )),
					lang ).build();

		} catch( CommandException e ) {
			response = RestServicesUtils.handleError(
					Status.CONFLICT,
					new RestError( ErrorCode.REST_APP_EXEC_ERROR, e, ErrorDetails.name( commandName )),
					lang ).build();

		} catch( Exception e ) {
			response = RestServicesUtils.handleError(
					Status.INTERNAL_SERVER_ERROR,
					new RestError( ErrorCode.REST_UNDETAILED_ERROR, e ),
					lang ).build();
		}

		return response;
	}
1301914
protected ActionCommand createCreateCommand()
    {
        ActionCommand command = new ActionCommand(CREATE_COMMAND_ID)
        {

            @Override
            protected void doExecuteCommand()
            {
                doCreate();
            }
        };
        command.setSecurityControllerId(getId() + "." + CREATE_COMMAND_ID);
        getApplicationConfig().commandConfigurer().configure(command);
        getDetailForm().addGuarded(command, FormGuard.LIKE_COMMITCOMMAND);
        return command;
    }
445415
function executeCommand(parameters) {
    if (!parameters.role && parameters.roleManually) { parameters.role = parameters.roleManually; }
    if (parameters.resourcePath.charAt(0) !== '/') { parameters.resourcePath = '/' + parameters.resourcePath; }

    // We calculate the path where we will save the specification and create the directory
    // Destructuring parameters only available in node 6 :(
    // specFilePath = path.join(process.cwd(), 'endpoints', ...answers.resourcePath.split('/'));
    const pathParts = parameters.resourcePath.split('/');
    pathParts.push(parameters.httpMethod);
    pathParts.unshift(path.join(process.cwd(), plugin.config.endpointsPath));
    const specFilePath = path.join.apply(null, pathParts);

    return mkdirpAsync(specFilePath)
    .then(() => {
      // We create the endpoint Swagger/OpenAPI specification
      const spec = {
        'x-myrmex': {
          'apis': parameters.apis
        },
        summary: parameters.summary,
        consume: parameters.consume,
        produce: parameters.produce,
        responses: {
          '200': {}
        },
        'x-amazon-apigateway-auth': {
          type: parameters.auth
        },
        'x-amazon-apigateway-integration': {
          credentials: parameters.role,
          responses: {
            default: {
              statusCode: 200
            }
          }
        }
      };
      switch (parameters.integration) {
        case 'lambda-proxy':
          spec['x-amazon-apigateway-integration'].type = 'aws_proxy';
          spec['x-amazon-apigateway-integration'].contentHandling = 'CONVERT_TO_TEXT';
          spec['x-amazon-apigateway-integration'].passthroughBehavior = 'when_no_match';
          spec['x-amazon-apigateway-integration'].httpMethod = 'POST';
          break;
        case 'mock':
          spec['x-amazon-apigateway-integration'].requestTemplates = {
            'application/json': '{"statusCode": 200}'
          };
          spec['x-amazon-apigateway-integration'].type = 'mock';
          spec['x-amazon-apigateway-integration'].passthroughBehavior = 'when_no_match';
          break;
      }
      config.specModifiers.forEach(fn => { fn(spec, parameters); });

      // We save the specification in a json file
      return fs.writeFileAsync(path.join(specFilePath, 'spec.json'), JSON.stringify(spec, null, 2));
    })
    .then(() => {
      const msg = '\n  The endpoint ' + icli.format.info(parameters.httpMethod + ' ' + parameters.resourcePath) + ' has been created\n\n'
                + '  Its OpenAPI specification is available in ' + icli.format.info(specFilePath + path.sep + 'spec.json') + '\n'
                + '  You can inspect it using the command '
                + icli.format.cmd('myrmex inspect-endpoint ' + parameters.resourcePath + ' ' + parameters.httpMethod) + '\n';
      icli.print(msg);
    });
  }
704307
@SuppressWarnings("unchecked")
        public static void executeCommand(String[] args) throws IOException {

            OptionParser parser = getParser();

            // declare parameters
            List<String> metaKeys = null;
            String url = null;

            // parse command-line input
            args = AdminToolUtils.copyArrayAddFirst(args, "--" + OPT_HEAD_META_CHECK);
            OptionSet options = parser.parse(args);
            if(options.has(AdminParserUtils.OPT_HELP)) {
                printHelp(System.out);
                return;
            }

            // check required options and/or conflicting options
            AdminParserUtils.checkRequired(options, OPT_HEAD_META_CHECK);
            AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_URL);

            // load parameters
            metaKeys = (List<String>) options.valuesOf(OPT_HEAD_META_CHECK);
            url = (String) options.valueOf(AdminParserUtils.OPT_URL);


            // execute command
            if(metaKeys.size() == 0
               || (metaKeys.size() == 1 && metaKeys.get(0).equals(METAKEY_ALL))) {
                metaKeys = Lists.newArrayList();
                metaKeys.add(MetadataStore.CLUSTER_KEY);
                metaKeys.add(MetadataStore.STORES_KEY);
                metaKeys.add(MetadataStore.SERVER_STATE_KEY);
            }

            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            doMetaCheck(adminClient, metaKeys);
        }
133865
void executeCommand() throws CertificateException {
        String exceptionMessage;
        Throwable cause = null;

        try {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Executing keytool command: " + this.toString());
            }
            Process proc = Runtime.getRuntime().exec(cmd.toArray(new String[cmd.size()]));

            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Waiting for keytool command process to complete...");
            }
            int exitCode = proc.waitFor();
            if (exitCode == 0) {
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("keytool command process completed successfully");
                }
                return;
            } else {
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("keytool command process failed to complete successfully (exit code: " + exitCode + ")");
                }
                exceptionMessage = getProcErrorOutput(proc);
            }
        } catch (IOException e) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("keytool command process execution resulted in IOException: " + e.getMessage());
            }
            exceptionMessage = e.getLocalizedMessage();
            cause = e;
        } catch (InterruptedException e) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("InterruptedException while waiting for keytool command process result: " + e.getMessage());
            }
            exceptionMessage = e.getLocalizedMessage();
            cause = e;
        }

        if (cause != null) {
            throw new CertificateException(exceptionMessage, cause);
        } else {
            throw new CertificateException(exceptionMessage);
        }
    }
584392
public function executeCommand(Command $command)
    {
        if ($command instanceof DsnDependent) {
            $command->setDsn($this->dsn);
        }

        $shellCmd = self::VTCTLD_EXECUTABLE . ' ' . $this->getServerString() . ' '
             . $command->getName() . ' ' . implode(' ', $command->getParams());

        exec($shellCmd, $output, $return);
        $output = implode("\n", $output);

        if ($return !== 0) {
            throw new Exception('Error running vtctld command - ' . $shellCmd . ', error: ' . $output);
        }

        $resultClass = $command->getResultClass();

        return new $resultClass($this->dsn, $output);
    }
622412
public <R> R executeAndQuery(ContextCommand<ROOT, R> cmd) {
        return Politician.beatAroundTheBush(() -> this.prevayler.execute(new InternalTransaction<>(cmd)));
    }