Fix deprecation warnings in the Google modules.

This commit is contained in:
Michael DeHaan 2013-10-19 12:57:47 -04:00
parent d73f5a4df0
commit aa93ce2dc2
4 changed files with 11 additions and 10 deletions

View file

@ -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)