Not able to update hostgroup members

26 views
Skip to first unread message

bin li

unread,
May 17, 2013, 10:38:16 AM5/17/13
to pynag-...@googlegroups.com
Tried the following code to update hostgoup members. "print h_group" shows the object was updated successfully but the hostgroups.cfg which includes this host group was not updated. Am I missing something?
           
h_group = Model.Hostgroup.objects.get_by_shortname('prodgrp')
h_group.members = hostgroup_members #assign the new members
h_group.save
print h_group

Thanks

Páll Sigurðsson

unread,
May 18, 2013, 8:30:56 AM5/18/13
to pynag-...@googlegroups.com
Hi bin,

try changing the third line to:
h_group.save()

It will work much better with the () after the save.


--
You received this message because you are subscribed to the Google Groups "pynag-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynag-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

bin li

unread,
May 20, 2013, 11:05:34 AM5/20/13
to pynag-...@googlegroups.com
Thanks, it works great.
Reply all
Reply to author
Forward
0 new messages