Example #1
0
  public static void deleteTemporaryObjects(
      String clientName, String objectName, String objectCursor, String cookbookPath) {

    System.out.println("Cleaning temorary items");
    System.out.println(cookbookPath);
    // Delete the test objects since we do not want to leave any
    // residue

    if (clientName != null && !clientName.isEmpty()) {
      KnifeUtils.runCommand(
          StringConstants.KNIFE
              + " "
              + objectCursor
              + " "
              + StringConstants.DELETE.toLowerCase()
              + " "
              + clientName
              + " "
              + objectCursor
              + " -y");

      KnifeUtils.runCommand(
          StringConstants.KNIFE
              + " "
              + StringConstants.CLIENT.toLowerCase()
              + " "
              + StringConstants.DELETE.toLowerCase()
              + " "
              + clientName
              + " "
              + " -y");
    } else if (!objectCursor.equals(StringConstants.DELETE)) {
      String output =
          KnifeUtils.runCommand(
              StringConstants.KNIFE
                  + " "
                  + objectCursor
                  + " "
                  + StringConstants.DELETE.toLowerCase()
                  + " "
                  + objectName
                  + " -y");
      System.out.println(output);
    }
    if (!cookbookPath.isEmpty() && cookbookPath != null) deleteCookbook(cookbookPath);
  }
Example #2
0
  public static void deleteTemporaryObjects(String clientName, String cookbookPath) {
    if (clientName != null && !clientName.isEmpty()) {

      KnifeUtils.runCommand(
          StringConstants.KNIFE
              + " "
              + StringConstants.CLIENT.toLowerCase()
              + " "
              + StringConstants.DELETE.toLowerCase()
              + " "
              + clientName
              + " "
              + " -y");
    } else if (!cookbookPath.isEmpty() && cookbookPath != null) deleteCookbook(cookbookPath);
  }