Skip to content

Commit 24d84cc

Browse files
committed
remove unnecesary logs
1 parent b514ed2 commit 24d84cc

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/main/groovy/com/rundeck/plugins/ansible/ansible/AnsibleRunner.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -942,10 +942,7 @@ String buildGroupVarsYaml(Map<String, String> hostPasswords, Map<String, String>
942942
String result = yamlContent.toString();
943943

944944
if(debug){
945-
System.err.println("DEBUG: Generated YAML content (" + result.length() + " bytes):");
946-
System.err.println("DEBUG: ========== YAML START ==========");
947-
System.err.println(result);
948-
System.err.println("DEBUG: ========== YAML END ==========");
945+
System.err.println("DEBUG: Generated YAML content (" + result.length() + " bytes)");
949946
}
950947

951948
return result;

src/main/groovy/com/rundeck/plugins/ansible/ansible/AnsibleRunnerContextBuilder.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,10 +953,14 @@ public Map<String, Map<String, String>> getNodesAuthenticationMap(){
953953
String password = getPasswordFromPath(keyPath);
954954
auth.put("ansible_password", password);
955955
} catch (ConfigurationException e) {
956-
System.err.println("DEBUG: Error retrieving password for " + node.getNodename() + ": " + e.getMessage());
956+
if (getDebug()) {
957+
System.err.println("DEBUG: Error retrieving password for " + node.getNodename() + ": " + e.getMessage());
958+
}
957959
throw new RuntimeException(e);
958960
} catch (Exception e2) {
959-
System.err.println("DEBUG: Unexpected error: " + e2.getMessage());
961+
if (getDebug()) {
962+
System.err.println("DEBUG: Unexpected error: " + e2.getMessage());
963+
}
960964
throw new RuntimeException(e2);
961965
}
962966

@@ -1045,7 +1049,9 @@ public Boolean generateInventoryNodesAuth() {
10451049
String getExecutionSpecificTmpDir() {
10461050
// Return cached directory if already created
10471051
if (executionSpecificDir != null) {
1048-
System.err.println("DEBUG: Using cached execution-specific directory: " + executionSpecificDir.getAbsolutePath());
1052+
if (getDebug()) {
1053+
System.err.println("DEBUG: Using cached execution-specific directory: " + executionSpecificDir.getAbsolutePath());
1054+
}
10491055
return executionSpecificDir.getAbsolutePath();
10501056
}
10511057

0 commit comments

Comments
 (0)