Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

GPII-4057: Fix use of removed to_hash in custom Stackdriver code #472

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions shared/rakefiles/stackdriver.rb
Expand Up @@ -85,7 +85,7 @@ def get_alert_policy_identifier(alert_policy)
end

def compare_alert_policies(stackdriver_alert_policy, alert_policy)
stackdriver_alert_policy = JSON.parse(stackdriver_alert_policy.to_hash.to_json)
stackdriver_alert_policy = JSON.parse(stackdriver_alert_policy.to_h.to_json)
["name", "creation_record", "mutated_by", "mutation_record"]. each do |attribute|
stackdriver_alert_policy.delete(attribute)
end
Expand All @@ -108,13 +108,13 @@ def compare_alert_policies(stackdriver_alert_policy, alert_policy)
end

def compare_notification_channels(stackdriver_notification_channel, notification_channel)
stackdriver_notification_channel = JSON.parse(stackdriver_notification_channel.to_hash.to_json)
stackdriver_notification_channel = JSON.parse(stackdriver_notification_channel.to_h.to_json)

return stackdriver_notification_channel != notification_channel
end

def debug_output(resource)
return JSON.pretty_generate(resource.to_hash)
return JSON.pretty_generate(resource.to_h)
end

def apply_log_based_metrics(log_based_metrics = [])
Expand Down