Examples of readTextFile()


Examples of org.platformlayer.ops.OpsTarget.readTextFile()

    command.setTimeout(TimeSpan.THIRTY_MINUTES);

    try {
      target.executeCommand(command);
    } catch (ProcessExecutionException e) {
      String debootstrapLog = target.readTextFile(new File(rootfsDir, "debootstrap/debootstrap.log"));
      log.warn("Debootstrap log: " + debootstrapLog);

      throw new OpsException("Error running debootstrap", e);
    }
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.readTextFile()

        target.mkdir(adminSshDir);

        String passphrase = "";
        target.executeCommand("ssh-keygen -t rsa -f {0} -P {1}", privateKeyFile, passphrase);

        String privateKeyData = target.readTextFile(privateKeyFile);
        String publicKeyData = target.readTextFile(publicKeyFile);

        target.executeCommand("cat {0} | sudo -H -u gitosis gitosis-init", publicKeyFile);

        target.setFileContents(authorizedKeys, publicKeyData);
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.readTextFile()

        String passphrase = "";
        target.executeCommand("ssh-keygen -t rsa -f {0} -P {1}", privateKeyFile, passphrase);

        String privateKeyData = target.readTextFile(privateKeyFile);
        String publicKeyData = target.readTextFile(publicKeyFile);

        target.executeCommand("cat {0} | sudo -H -u gitosis gitosis-init", publicKeyFile);

        target.setFileContents(authorizedKeys, publicKeyData);
        target.executeCommand("chown -R {0} {1}", adminUser, adminSshDir);
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.readTextFile()

    // Fix hostname
    File hostsFile = new File("/etc/hosts");

    String hostLine = "127.0.0.1\t" + hostname;

    String hosts = target.readTextFile(hostsFile);

    boolean found = false;
    for (String line : Splitter.on("\n").trimResults().split(hosts)) {
      if (line.equals(hostLine)) {
        found = true;
View Full Code Here

Examples of org.platformlayer.ops.OpsTarget.readTextFile()

    File path = new File(DnsServerTemplate.getZonesDir(), zoneFile.getKey());
    String data = zoneFile.getData();

    OpsTarget target = targetServer.getTarget();

    String existing = target.readTextFile(path);
    boolean isSame = Objects.equal(data, existing);

    if (!isSame) {
      // TODO: The serial value means that this is always dirty
      log.info("Uploading zone file: " + path);
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.