Permalink
Browse files

Merge pull request #11019 from cachedout/10945

Fix highstate output
  • Loading branch information...
2 parents ebe91bd + 5f9c0bc commit 1e5e9c88d5fcbc1d87d0e00af5bbc0c6274fe518 @thatch45 thatch45 committed Mar 7, 2014
Showing with 9 additions and 3 deletions.
  1. +9 −3 salt/output/highstate.py
View
@@ -122,14 +122,20 @@ def _format_host(host, data):
if comps[1] != comps[2]:
state_lines.insert(
3, ' {tcolor} Name: {comps[2]}{colors[ENDC]}')
+ try:
+ comment = ret['comment'].strip().replace(
+ '\n',
+ '\n' + ' ' * 14)
+ except AttributeError:
+ comment = ret['comment'].join(' ').replace(
+ '\n',
+ '\n' + ' ' * 13)
svars = {
'tcolor': tcolor,
'comps': comps,
'ret': ret,
+ 'comment': comment,
# This nukes any trailing \n and indents the others.
- 'comment': ret['comment'].strip().replace(
- '\n',
- '\n' + ' ' * 14),
'colors': colors
}
hstrs.extend([sline.format(**svars) for sline in state_lines])

0 comments on commit 1e5e9c8

Please sign in to comment.