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
a080873e
Commit
a080873e
authored
Jun 05, 2014
by
Hector Acosta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show friendlier error message if nova.ini is not found.
Signed-off-by: Hector Acosta <hector.acosta@gmail.com>
parent
ab956e8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
plugins/inventory/nova.py
+13
-13
No files found.
plugins/inventory/nova.py
View file @
a080873e
...
...
@@ -144,23 +144,23 @@ except:
# executed with no parameters, return the list of
# all groups and hosts
NOVA_CONFIG_FILES
=
[
os
.
getcwd
()
+
"/nova.ini"
,
os
.
path
.
expanduser
(
os
.
environ
.
get
(
'ANSIBLE_CONFIG'
,
"~/nova.ini"
)),
"/etc/ansible/nova.ini"
]
def
nova_load_config_file
():
p
=
ConfigParser
.
SafeConfigParser
()
path1
=
os
.
getcwd
()
+
"/nova.ini"
path2
=
os
.
path
.
expanduser
(
os
.
environ
.
get
(
'ANSIBLE_CONFIG'
,
"~/nova.ini"
))
path3
=
"/etc/ansible/nova.ini"
if
os
.
path
.
exists
(
path1
):
p
.
read
(
path1
)
elif
os
.
path
.
exists
(
path2
):
p
.
read
(
path2
)
elif
os
.
path
.
exists
(
path3
):
p
.
read
(
path3
)
else
:
return
None
return
p
for
path
in
NOVA_CONFIG_FILES
:
if
os
.
path
.
exists
(
path
):
p
.
read
(
path
)
return
p
return
None
config
=
nova_load_config_file
()
if
not
config
:
sys
.
exit
(
'Unable to find configfile in
%
s'
%
', '
.
join
(
NOVA_CONFIG_FILES
))
client
=
nova_client
.
Client
(
version
=
config
.
get
(
'openstack'
,
'version'
),
...
...
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