Skip to content

Commit

Permalink
cleanup small typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mchugh19 committed Sep 5, 2014
1 parent e867b0d commit 50e2f9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/waytta/SaltAPIBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
//Setup connection for auth
String auth = "username="+username+"&password="+userpass+"&eauth="+authtype;
String httpResponse = new String();
String token = new String();
httpResponse = sendJSON(servername, auth, null);
if (httpResponse.contains("java.io.IOException") || httpResponse.contains("java.net.SocketTimeoutException")) {
listener.getLogger().println("Error: "+httpResponse);
Expand All @@ -195,13 +196,12 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
try {
JSONObject authresp = (JSONObject) JSONSerializer.toJSON(httpResponse);
JSONArray returnArray = authresp.getJSONArray("return");
String token = new String();
for (Object o : returnArray ) {
JSONObject line = (JSONObject) o;
token = line.getString("token");
}
} catch (Exception e) {
listener.getLogger().println("JSON Error: "e+"\n\n"+httpResponse);
listener.getLogger().println("JSON Error: "+e+"\n\n"+httpResponse);
return false;
}

Expand Down

0 comments on commit 50e2f9c

Please sign in to comment.