Advertisement
FamiHug

error

Feb 26th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. ceph:
  2. osd.0:
  3. host: ubun1
  4. devs: /dev/hihi
  5. mon.a:
  6. host: ubun1
  7. ods.1:
  8. host: ubun2
  9. devs: /dev/h2
  10.  
  11. In [32]: data['ceph']
  12. Out[32]:
  13. {'mon.a': {'host': 'ubun1'},
  14. 'ods.1': {'devs': '/dev/h2', 'host': 'ubun2'},
  15. 'osd.0': {'devs': '/dev/hihi', 'host': 'ubun1'}}
  16.  
  17.  
  18. {% for i in pillar['ceph'] %}
  19. [{{ pillar[i] }}]
  20. {% if i.startswith('mon') %}
  21. host = {{ pillar['ceph'][i]['host'] }}
  22. mon addr = {{ pillar['ceph'][i]['ip'] }}:6789
  23. {% elif i.startswith('osd') %}
  24. host = {{ pillar['ceph'][i]['host'] }}
  25. devs = {{ pillar['ceph'][i]['devs'] }}
  26. {% elif i.startswith('mds') %}
  27. host = {{ pillar['ceph'][i]['host'] }}
  28. {% endif %}
  29. {% endfor %}
  30.  
  31. State: - file
  32. Name: /etc/ceph/ceph.conf
  33. Function: managed
  34. Result: False
  35. Comment: Traceback (most recent call last):
  36. File "/usr/lib/pymodules/python2.7/salt/utils/templates.py", line 55, in render_tmpl
  37. output = render_str(tmplstr, context, tmplpath)
  38. File "/usr/lib/pymodules/python2.7/salt/utils/templates.py", line 98, in render_jinja_tmpl
  39. output = jinja_env.from_string(tmplstr).render(**context)
  40. File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 894, in render
  41. return self.environment.handle_exception(exc_info, True)
  42. File "<template>", line 12, in top-level template code
  43. UndefinedError: 'dict object' has no attribute 'mon.a'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement