示例#1
0
  public SSHConfig sshConfiguration() {
    if (this.sshConfig == null) {
      this.sshConfig = vagrant.execute(new GetSshConfig());
    }

    return this.sshConfig;
  }
示例#2
0
 public void rollback() {
   if (transactional) {
     vagrant.execute(new Rollback());
     return;
   }
   throw new IllegalArgumentException(
       "You have to create Vagrant object with transactional=true to use transactions.");
 }
示例#3
0
  public void ensureBoxExists(Box box) {
    for (String boxName : vagrant.execute(new ListBoxes())) {
      if (boxName.equals(box.getName())) {
        return;
      }
    }

    File oldWorkingDir = sh.getWorkingDir();
    try {
      sh.setWorkingDir(File.createTempFile("ignore", "").getParentFile());

      vagrant.execute(new AddBox(box));

      sh.setWorkingDir(oldWorkingDir);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
示例#4
0
 public VirtualMachineState state() {
   return vagrant.execute(new GetState());
 }
示例#5
0
 public void destroy() {
   vagrant.execute(new Destroy());
 }
示例#6
0
 public void halt() {
   vagrant.execute(new Halt());
 }
示例#7
0
 public void up() {
   vagrant.execute(new Up());
   if (transactional) vagrant.execute(new EnableSandbox(true));
 }
示例#8
0
 public void init() {
   vagrant.execute(new Init(definition.box().getName()));
 }