jobs: The patch remove the password from resultObject and make it be humanreadable (#4538)

This PR fixes CLOUDSTACK-10425.

Co-authored-by: lujie <lujie@foxmail.com>
This commit is contained in:
lujiefsi 2020-12-14 14:09:54 +08:00 committed by GitHub
parent bd38f0647f
commit 3689b9da41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,9 +257,9 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
@Override
@DB
public void completeAsyncJob(final long jobId, final Status jobStatus, final int resultCode, final String resultObject) {
String resultObj = null;
if (s_logger.isDebugEnabled()) {
String resultObj = obfuscatePassword(resultObject, HidePassword.value());
resultObj = convertHumanReadableJson(resultObj);
resultObj = convertHumanReadableJson(obfuscatePassword(resultObject, HidePassword.value()));
s_logger.debug("Complete async job-" + jobId + ", jobStatus: " + jobStatus + ", resultCode: " + resultCode + ", result: " + resultObj);
}
@ -268,7 +268,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
if (job == null) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("job-" + jobId + " no longer exists, we just log completion info here. " + jobStatus + ", resultCode: " + resultCode + ", result: " +
resultObject);
resultObj);
}
// still purge item from queue to avoid any blocking
_queueMgr.purgeAsyncJobQueueItemId(jobId);