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
36c75d6c
Commit
36c75d6c
authored
Oct 15, 2014
by
szk.kentaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --pretty option for gce inventory plugin
parent
bdf3ec1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
plugins/inventory/gce.py
+6
-2
No files found.
plugins/inventory/gce.py
View file @
36c75d6c
...
...
@@ -103,11 +103,13 @@ class GceInventory(object):
# Just display data for specific host
if
self
.
args
.
host
:
print
self
.
json_format_dict
(
self
.
node_to_dict
(
self
.
get_instance
(
self
.
args
.
host
)))
self
.
get_instance
(
self
.
args
.
host
)),
pretty
=
self
.
args
.
pretty
)
sys
.
exit
(
0
)
# Otherwise, assume user wants all instances grouped
print
(
self
.
json_format_dict
(
self
.
group_instances
()))
print
(
self
.
json_format_dict
(
self
.
group_instances
(),
pretty
=
self
.
args
.
pretty
))
sys
.
exit
(
0
)
def
get_gce_driver
(
self
):
...
...
@@ -187,6 +189,8 @@ class GceInventory(object):
help
=
'List instances (default: True)'
)
parser
.
add_argument
(
'--host'
,
action
=
'store'
,
help
=
'Get all information about an instance'
)
parser
.
add_argument
(
'--pretty'
,
action
=
'store_true'
,
default
=
False
,
help
=
'Pretty format (default: False)'
)
self
.
args
=
parser
.
parse_args
()
...
...
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