Skip to content

Commit

Permalink
Fix the dumpvars command for 2.0 to eliminate traceback and also print
Browse files Browse the repository at this point in the history
key-by-key instead of as a raw datastructure.
  • Loading branch information
Michael DeHaan committed Sep 28, 2009
1 parent 8053d71 commit 9411131
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Cobbler CHANGELOG
- (BUGF) Cleaned up generated comments in settings files
- (BUGF) Unhide per-system post-install kernel options
- (BUGF) Unhide owners fields
- (BUGF) fix "cobbler profile/system dumpvars" command

- Sep 17 2009 - for 2.0 release
- Development release start
Expand Down
5 changes: 4 additions & 1 deletion cobbler/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ def object_command(self, object_type, object_action):
elif object_type == "system":
data = self.remote.get_blended_data("",options.name)
# FIXME: pretty-printing and sorting here
print data
keys = data.keys()
keys.sort()
for x in keys:
print "%s : %s" % (x, data[x])
elif object_action in [ "poweron", "poweroff", "reboot" ]:
power={}
power["power"] = object_action.replace("power","")
Expand Down
2 changes: 1 addition & 1 deletion cobbler/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ def generate_kickstart(self,profile=None,system=None,REMOTE_ADDR=None,REMOTE_MAC
return self.api.generate_kickstart(profile,system)

def get_blended_data(self,profile=None,system=None):
if profile is not None:
if profile is not None and profile != "":
obj = self.api.find_profile(profile)
else:
obj = self.api.find_system(system)
Expand Down

0 comments on commit 9411131

Please sign in to comment.