mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-24 17:20:22 -07:00
Fix deprecation warnings in the Google modules.
This commit is contained in:
parent
d73f5a4df0
commit
aa93ce2dc2
4 changed files with 11 additions and 10 deletions
|
@ -112,7 +112,7 @@ except ImportError:
|
|||
ARGS = getattr(secrets, 'GCE_PARAMS', ())
|
||||
KWARGS = getattr(secrets, 'GCE_KEYWORD_PARAMS', {})
|
||||
|
||||
if not ARGS or not KWARGS.has_key('project'):
|
||||
if not ARGS or not 'project' in KWARGS:
|
||||
print("failed=True " + \
|
||||
"msg='Missing GCE connection parameters in libcloud secrets file.'")
|
||||
sys.exit(1)
|
||||
|
@ -195,7 +195,8 @@ def main():
|
|||
module.fail_json(msg="Must supply a size_gb", changed=False)
|
||||
try:
|
||||
size_gb = int(round(float(size_gb)))
|
||||
if size_gb < 1: raise Exception
|
||||
if size_gb < 1:
|
||||
raise Exception
|
||||
except:
|
||||
module.fail_json(msg="Must supply a size_gb larger than 1 GB",
|
||||
changed=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue