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
e2a8a68c
Commit
e2a8a68c
authored
Aug 07, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up some debugging/commented code from #11709
parent
54bab2c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
contrib/inventory/cobbler.py
+2
-9
No files found.
contrib/inventory/cobbler.py
View file @
e2a8a68c
...
...
@@ -169,19 +169,13 @@ class CobblerInventory(object):
dns_name
=
host
[
'hostname'
]
#None
ksmeta
=
None
interfaces
=
host
[
'interfaces'
]
#for (iname, ivalue) in interfaces.iteritems():
# if ivalue['management']:
# this_dns_name = ivalue.get('dns_name', None)
# #this_dns_name = ivalue.get('ip_address', None)
# if this_dns_name is not None and this_dns_name is not "":
# dns_name = this_dns_name
if
dns_name
is
None
:
continue
status
=
host
[
'status'
]
profile
=
host
[
'profile'
]
classes
=
host
[
orderby_keyname
]
#host['mgmt_classes']
classes
=
host
[
orderby_keyname
]
if
status
not
in
self
.
inventory
:
self
.
inventory
[
status
]
=
[]
...
...
@@ -200,7 +194,7 @@ class CobblerInventory(object):
# The old way was ksmeta only -- provide backwards compatibility
self
.
cache
[
dns_name
]
=
host
#dict() # sub dict with host to output json
self
.
cache
[
dns_name
]
=
host
if
"ks_meta"
in
host
:
for
key
,
value
in
host
[
"ks_meta"
]
.
iteritems
():
self
.
cache
[
dns_name
][
key
]
=
value
...
...
@@ -249,7 +243,6 @@ class CobblerInventory(object):
def
write_to_cache
(
self
,
data
,
filename
):
""" Writes data in JSON format to a file """
#if data: print "DEBUG: data = " + str(data)
json_data
=
self
.
json_format_dict
(
data
,
True
)
cache
=
open
(
filename
,
'w'
)
cache
.
write
(
json_data
)
...
...
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