Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes for GCP (as of 2019-06-12T06:05:42Z) #57727

Merged
merged 1 commit into from Jun 13, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Bug fixes for GCP modules

  • Loading branch information...
modular-magician committed Jun 13, 2019
commit 30d48c5ee80b3f55d1a9c5dd4d61b8dc87665f92
@@ -49,6 +49,10 @@ def remove_nones_from_dict(obj):
value = obj[key]
if value is not None and value != {} and value != []:
new_obj[key] = value

# Blank dictionaries should return None or GCP API may complain.
if not new_obj:
return None
return new_obj


@@ -76,12 +80,7 @@ def __init__(self, module, product):
def get(self, url, body=None, **kwargs):
kwargs.update({'json': body, 'headers': self._headers()})
try:
# Ignore the google-auth library warning for user credentials. More
# details: https://github.com/googleapis/google-auth-library-python/issues/271
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", "Your application has authenticated using end user credentials")
return self.session().get(url, **kwargs)
return self.session().get(url, **kwargs)
except getattr(requests.exceptions, 'RequestException') as inst:
self.module.fail_json(msg=inst.message)

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.