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
5efa4d29
Commit
5efa4d29
authored
Oct 09, 2015
by
soarpenguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some warning of undefined name.
parent
59d655c5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
8 deletions
+13
-8
lib/ansible/module_utils/gce.py
+1
-0
lib/ansible/module_utils/vca.py
+4
-3
lib/ansible/new_inventory/__init__.py
+4
-1
lib/ansible/plugins/inventory/directory.py
+2
-2
lib/ansible/plugins/inventory/ini.py
+2
-2
No files found.
lib/ansible/module_utils/gce.py
View file @
5efa4d29
...
...
@@ -28,6 +28,7 @@
#
import
pprint
from
libcloud.compute.providers
import
get_driver
USER_AGENT_PRODUCT
=
"Ansible-gce"
USER_AGENT_VERSION
=
"v1"
...
...
lib/ansible/module_utils/vca.py
View file @
5efa4d29
...
...
@@ -76,7 +76,7 @@ class VcaAnsibleModule(AnsibleModule):
gateway_name
=
self
.
params
[
'gateway_name'
]
_gateway
=
self
.
vca
.
get_gateway
(
vdc_name
,
gateway_name
)
if
not
_gateway
:
raise
VcaError
(
'vca instance has no gateway named
%
s'
%
name
)
raise
VcaError
(
'vca instance has no gateway named
%
s'
%
gateway_
name
)
self
.
_gateway
=
_gateway
return
_gateway
...
...
@@ -84,9 +84,10 @@ class VcaAnsibleModule(AnsibleModule):
def
vdc
(
self
):
if
self
.
_vdc
is
not
None
:
return
self
.
_vdc
_vdc
=
self
.
vca
.
get_vdc
(
self
.
params
[
'vdc_name'
])
vdc_name
=
self
.
params
[
'vdc_name'
]
_vdc
=
self
.
vca
.
get_vdc
(
vdc_name
)
if
not
_vdc
:
raise
VcaError
(
'vca instance has no vdc named
%
s'
%
name
)
raise
VcaError
(
'vca instance has no vdc named
%
s'
%
vdc_
name
)
self
.
_vdc
=
_vdc
return
_vdc
...
...
lib/ansible/new_inventory/__init__.py
View file @
5efa4d29
...
...
@@ -21,10 +21,13 @@
from
__future__
import
(
absolute_import
,
division
,
print_function
)
__metaclass__
=
type
import
re
import
sys
from
ansible
import
constants
as
C
from
ansible.inventory.group
import
Group
from
.host
import
Host
from
ansible.plugins.inventory.aggregate
import
InventoryAggregateParser
from
ansible
import
errors
class
Inventory
:
'''
...
...
@@ -98,7 +101,7 @@ class Inventory:
'''
for
group
in
self
.
_groups
:
if
group
.
name
==
group
_
name
:
if
group
.
name
==
groupname
:
return
group
return
None
...
...
lib/ansible/plugins/inventory/directory.py
View file @
5efa4d29
...
...
@@ -47,9 +47,9 @@ class InventoryDirectoryParser(InventoryAggregateParser):
if
filename
in
(
"host_vars"
,
"group_vars"
,
"vars_plugins"
):
continue
fullpath
=
os
.
path
.
join
(
directory
,
filename
)
new
_names
.
append
(
fullpath
)
filtered
_names
.
append
(
fullpath
)
super
(
InventoryDirectoryParser
,
self
)
.
__init__
(
new
_names
)
super
(
InventoryDirectoryParser
,
self
)
.
__init__
(
filtered
_names
)
def
parse
(
self
):
return
super
(
InventoryDirectoryParser
,
self
)
.
parse
()
lib/ansible/plugins/inventory/ini.py
View file @
5efa4d29
...
...
@@ -47,9 +47,9 @@ class InventoryIniParser(InventoryAggregateParser):
if
filename
in
(
"host_vars"
,
"group_vars"
,
"vars_plugins"
):
continue
fullpath
=
os
.
path
.
join
(
directory
,
filename
)
new
_names
.
append
(
fullpath
)
filtered
_names
.
append
(
fullpath
)
super
(
InventoryDirectoryParser
,
self
)
.
__init__
(
new
_names
)
super
(
InventoryDirectoryParser
,
self
)
.
__init__
(
filtered
_names
)
def
parse
(
self
):
return
super
(
InventoryDirectoryParser
,
self
)
.
parse
()
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