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
13da0395
Commit
13da0395
authored
Oct 20, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9338 from szkkentaro/gce_inventory/add_pretty_option
Add --pretty option for gce inventory plugin
parents
a60fd581
36c75d6c
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 @
13da0395
...
...
@@ -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