Examples of CommandEnvironment


Examples of org.platformlayer.ops.CommandEnvironment

      return;
    }

    log.info("Updating apt repositories");

    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);

    Command command = Command.build("apt-get --yes update");
    command = command.setEnvironment(commandEnvironment).setTimeout(TimeSpan.TEN_MINUTES);
    executeAptCommand(target, command);
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

      return;
    }
  }

  private void doDpkgConfigure(OpsTarget target) throws OpsException {
    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);
    Command command = Command.build("dpkg --configure -a");
    command = command.setEnvironment(commandEnvironment).setTimeout(TimeSpan.TEN_MINUTES);
    target.executeCommand(command);
  }
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

  CommandEnvironment httpProxyEnvironment = null;

  public CommandEnvironment getHttpProxyEnvironment(OpsTarget target, Usage usage, URI uri) throws OpsException {
    if (httpProxyEnvironment == null) {
      List<String> proxies = findHttpProxies(target, uri);
      httpProxyEnvironment = new CommandEnvironment();

      String proxy = chooseProxy(target, proxies);
      if (proxy != null) {
        log.info("Will use http proxy: " + proxy);
        httpProxyEnvironment.put("http_proxy", proxy);
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

    command.addQuoted("--username=", username);
    command.addQuoted("--host=", hostname);

    command.addArgument(Argument.buildQuoted("--command=", sql).setMasked("--command=" + Command.MASKED));

    CommandEnvironment env = new CommandEnvironment();
    env.put("PGPASSWORD", password.plaintext());

    command.setEnvironment(env);
    return target.executeCommand(command);
  }
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

    }

    if (InetAddressUtils.isPublic(host)) {
      CurlRequest curlRequest = new CurlRequest(uri);
      curlRequest.bareRequest = true;
      CommandEnvironment commandEnvironment = httpProxies.getHttpProxyEnvironment(target, Usage.General, uri);

      Command curlCommand = curlRequest.toCommand();
      curlCommand.addLiteral(">");
      curlCommand.addFile(remoteFilePath);
      curlCommand.setEnvironment(commandEnvironment);
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

      target.mkdir(remoteFilePath.getParentFile());

      CurlRequest curlRequest = new CurlRequest(url);
      curlRequest.bareRequest = true;

      CommandEnvironment commandEnvironment = httpProxies.getHttpProxyEnvironment(target, Usage.General, url);

      Command curlCommand = curlRequest.toCommand();
      curlCommand.addLiteral(">");
      curlCommand.addFile(remoteFilePath);
      curlCommand.setEnvironment(commandEnvironment);
View Full Code Here

Examples of org.platformlayer.ops.CommandEnvironment

          @Override
          public void execute(OpsTarget target, ManagedFilesystemItem managedFilesystemItem)
              throws OpsException {
            if (managedFilesystemItem.getNewFileWasCreated()) {
              // Set the parameters the ifup sets
              CommandEnvironment env = new CommandEnvironment();
              env.put("MODE", "start");
              env.put("IFACE", "--all");
              env.put("ADDRFAM", "meta");

              Command runLockdown = Command.build("/etc/network/if-pre-up.d/iptables-lockdown");
              runLockdown.setEnvironment(env);
              target.executeCommand(runLockdown);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.