Skip to content

Commit

Permalink
NMS-15717 : DeviceConfig via Minion fails if sshScript output contain…
Browse files Browse the repository at this point in the history
…s control characters.(update code).
  • Loading branch information
Junaid-Khan-Nant committed Jan 15, 2025
1 parent 2537b17 commit 7e740ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2023 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2023 The OpenNMS Group, Inc.
* Copyright (C) 2025 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2025 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
Expand All @@ -28,7 +28,6 @@

package org.opennms.netmgt.poller;

import org.eclipse.persistence.exceptions.XMLMarshalException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -47,12 +46,8 @@ public String unmarshal(String v) throws Exception {
v = v.replace("
", "\r")
.replace("
", "\n");
}
try {
return v;
} catch (XMLMarshalException e) {
LOG.warn("Unable to unmarshal escape sequences value '{}' to a script output. Returning null instead.", v);
return null;
}

}

@Override
Expand All @@ -61,11 +56,7 @@ public String marshal(String v) throws Exception {
v = v.replace("\r", "
")
.replace("\n", "
");
}
try {
return v;
} catch (XMLMarshalException e) {
LOG.warn("Unable to marshal escape sequences value '{}' to a script output. Returning null instead.", v);
return null;
}

}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2023 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2023 The OpenNMS Group, Inc.
* Copyright (C) 2025 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2025 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2023 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2023 The OpenNMS Group, Inc.
* Copyright (C) 2025 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2025 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
Expand Down

0 comments on commit 7e740ee

Please sign in to comment.