Skip to content

Commit

Permalink
Fixed Logging Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bhillkeyfactor committed Jun 18, 2024
1 parent 011d938 commit bb16e4b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions PaloAlto/Jobs/Management.cs
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,10 @@ private string GetPemFile(ManagementJobConfiguration config)
private string CommitChanges(ManagementJobConfiguration config, PaloAltoClient client, string warnings)
{
_logger.MethodEntry();
var commitResponse = client.GetCommitResponse();
var commitResponse = client.GetCommitResponse().Result;
_logger.LogTrace("Got client commit response, attempting to log it");
LogResponse(commitResponse);
if (commitResponse.Result.Status == "success")
if (commitResponse.Status == "success")
{
_logger.LogTrace("Commit response shows success");
//Check to see if it is a Panorama instance (not "/" or empty store path) if Panorama, push to corresponding firewall devices
Expand All @@ -600,16 +600,16 @@ private string CommitChanges(ManagementJobConfiguration config, PaloAltoClient c
_logger.LogTrace("It is a panorama device, build some delay in there so it works, pan issue.");
Thread.Sleep(120000); //Some delay built in so pushes to devices work
_logger.LogTrace("Done sleeping");
var commitAllResponse = client.GetCommitAllResponse(deviceGroup);
var commitAllResponse = client.GetCommitAllResponse(deviceGroup).Result;
_logger.LogTrace("Logging commit response from panorama.");
LogResponse(commitAllResponse);
if (commitAllResponse.Result.Status != "success")
warnings += $"The push to firewall devices failed. {commitAllResponse.Result.Text}";
if (commitAllResponse.Status != "success")
warnings += $"The push to firewall devices failed. {commitAllResponse.Text}";
}
}
else
{
warnings += $"The commit to the device failed. {commitResponse.Result.Text}";
warnings += $"The commit to the device failed. {commitResponse.Text}";
}

return warnings;
Expand Down

0 comments on commit bb16e4b

Please sign in to comment.