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
4c7843f2
Commit
4c7843f2
authored
Sep 26, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12532 from fboender/devel
Output proper JSON from vbox dynamic inventory contrib script
parents
abfeb104
c6c3ce66
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
contrib/inventory/vbox.py
+6
-2
No files found.
contrib/inventory/vbox.py
View file @
4c7843f2
...
@@ -23,6 +23,11 @@ try:
...
@@ -23,6 +23,11 @@ try:
except
ImportError
:
except
ImportError
:
import
simplejson
as
json
import
simplejson
as
json
class
SetEncoder
(
json
.
JSONEncoder
):
def
default
(
self
,
obj
):
if
isinstance
(
obj
,
set
):
return
list
(
obj
)
return
json
.
JSONEncoder
.
default
(
self
,
obj
)
VBOX
=
"VBoxManage"
VBOX
=
"VBoxManage"
...
@@ -110,5 +115,4 @@ if __name__ == '__main__':
...
@@ -110,5 +115,4 @@ if __name__ == '__main__':
else
:
else
:
inventory
=
get_hosts
()
inventory
=
get_hosts
()
import
pprint
sys
.
stdout
.
write
(
json
.
dumps
(
inventory
,
indent
=
2
,
cls
=
SetEncoder
))
pprint
.
pprint
(
inventory
)
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