Skip to content

Commit

Permalink
Use obj._render() instead
Browse files Browse the repository at this point in the history
  • Loading branch information
thekad committed May 27, 2011
1 parent 4632799 commit a608e98
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions test_nagii.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

import nagii

tpl = """
define ${obj._type} {
% for k,v in obj._public().items():
${"%-40s%s" % (k,v)}
% endfor
}
"""

host_template = nagii.NagiosTemplate(name="generic-host",
max_check_attempts=1, check_period=5,
contact_groups="nagiosadmin", notification_interval=5,
Expand Down Expand Up @@ -48,6 +40,7 @@
service_notification_commands='notify-by-email',
host_notification_commands='host-notify-by-email')
contact_template._set_type('contact')
contact_template._custom_command = 'boo'

contacts = []

Expand All @@ -61,7 +54,6 @@
contacts[0]._add_to_group(contact_group2)


tpl = mako_template.Template(tpl)
for x in [ host_group, host_group2, host_group3, host_template ] + hosts + [ contact_group, contact_group2, contact_template ] + contacts:
print tpl.render(obj=x)
print x._render()

0 comments on commit a608e98

Please sign in to comment.