Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
aa93ce2d
Commit
aa93ce2d
authored
Oct 19, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deprecation warnings in the Google modules.
parent
d73f5a4d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
library/cloud/gce
+5
-5
library/cloud/gce_lb
+2
-2
library/cloud/gce_net
+1
-1
library/cloud/gce_pd
+3
-2
No files found.
library/cloud/gce
View file @
aa93ce2d
...
...
@@ -178,7 +178,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 parametres in libcloud secrets file.'"
)
sys
.
exit
(
1
)
...
...
@@ -196,7 +196,7 @@ def get_instance_info(inst):
"""
metadata
=
{}
if
inst
.
extra
.
has_key
(
'metadata'
)
and
inst
.
extra
[
'metadata'
]
.
has_key
(
'items'
)
:
if
'metadata'
in
inst
.
extra
and
'items'
in
inst
.
extra
[
'metadata'
]
:
for
md
in
inst
.
extra
[
'metadata'
][
'items'
]:
metadata
[
md
[
'key'
]]
=
md
[
'value'
]
...
...
@@ -212,9 +212,9 @@ def get_instance_info(inst):
'network'
:
netname
,
'private_ip'
:
inst
.
private_ip
[
0
],
'public_ip'
:
inst
.
public_ip
[
0
],
'status'
:
inst
.
extra
.
has_key
(
'status'
)
and
inst
.
extra
[
'status'
]
or
None
,
'tags'
:
inst
.
extra
.
has_key
(
'tags'
)
and
inst
.
extra
[
'tags'
]
or
[],
'zone'
:
inst
.
extra
.
has_key
(
'zone'
)
and
inst
.
extra
[
'zone'
]
.
name
or
None
,
'status'
:
(
'status'
in
inst
.
extra
)
and
inst
.
extra
[
'status'
]
or
None
,
'tags'
:
(
'tags'
in
inst
.
extra
)
and
inst
.
extra
[
'tags'
]
or
[],
'zone'
:
(
'zone'
in
inst
.
extra
)
and
inst
.
extra
[
'zone'
]
.
name
or
None
,
})
def
create_instances
(
module
,
gce
,
instance_names
):
...
...
library/cloud/gce_lb
View file @
aa93ce2d
...
...
@@ -152,7 +152,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
)
...
...
@@ -290,7 +290,7 @@ def main():
json_output
[
'external_ip'
]
=
lb
.
ip
json_output
[
'port_range'
]
=
lb
.
port
hc_names
=
[]
if
lb
.
extra
.
has_key
(
'healthchecks'
)
:
if
'healthchecks'
in
lb
.
extra
:
for
hc
in
lb
.
extra
[
'healthchecks'
]:
hc_names
.
append
(
hc
.
name
)
json_output
[
'httphealthchecks'
]
=
hc_names
...
...
library/cloud/gce_net
View file @
aa93ce2d
...
...
@@ -117,7 +117,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
)
...
...
library/cloud/gce_pd
View file @
aa93ce2d
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment