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

Commit

Permalink
Merge pull request #472 from stepanstipl/fix-no-to_hash-stackdriver
Browse files Browse the repository at this point in the history
GPII-4057: Fix use of removed to_hash in custom Stackdriver code
  • Loading branch information
Stepan Stipl committed Aug 7, 2019
2 parents d11bd1b + c8ab105 commit 1a79a84
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 1a79a84

Please sign in to comment.