From 2f92f3155aeb399cd088ec0f28deecdda5524cb9 Mon Sep 17 00:00:00 2001 From: Ludovic LANGE Date: Wed, 14 Sep 2016 14:44:49 +0200 Subject: [PATCH] Allow targeting of managed policies. This changes allows option --target to also filter managed policies name - as expected. --- lib/miam/client.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/miam/client.rb b/lib/miam/client.rb index 7dee1b5..1d0c6b6 100644 --- a/lib/miam/client.rb +++ b/lib/miam/client.rb @@ -445,6 +445,7 @@ def pre_walk_managed_policies(expected, actual) updated = false expected.each do |policy_name, expected_attrs| + next unless target_matched?(policy_name) actual_attrs = actual.delete(policy_name) if actual_attrs @@ -479,6 +480,7 @@ def post_walk_managed_policies(actual) updated = false actual.each do |policy_name, actual_attrs| + next unless target_matched?(policy_name) @driver.delete_managed_policy(policy_name, actual_attrs[:path]) updated = true end