diff --git a/salt/cloud/__init__.py b/salt/cloud/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/__init__.py
+++ b/salt/cloud/__init__.py
@@ -231,7 +231,7 @@ class CloudClient(object):
                          if a.get('provider', '')]
             if providers:
                 _providers = opts.get('providers', {})
-                for provider in _providers:
+                for provider in list(_providers):
                     if provider not in providers:
                         _providers.pop(provider)
         return opts
use list on providers

This is needed because we are modifying the size of the dictionary
inside the loop.