small bugfixes in members and tasks parsing

This commit is contained in:
RafTim 2013-11-09 01:05:37 +01:00
commit 3ef1dcecd7
4 changed files with 15 additions and 12 deletions

View file

@ -36,24 +36,24 @@ class HostGroupMissingArgumentException(HostGroupException):
class HostGroup(object):
def __init__(self, name, **kwargs):
self.name = name
def __init__(self, _name, **kwargs):
self.name = _name
tmp = "members"
self.members = []
if not tmp in kwargs:
raise HostGroupMissingArgumentException(tmp, name)
raise HostGroupMissingArgumentException(tmp, _name)
self.add_members(kwargs[tmp])
tmp = "hosts"
self.hosts = []
if not tmp in kwargs:
raise HostGroupMissingArgumentException(tmp, name)
raise HostGroupMissingArgumentException(tmp, _name)
self.add_hosts(kwargs[tmp])
tmp = "services"
self.__services = []
if not tmp in kwargs:
raise HostGroupMissingArgumentException(tmp, name)
raise HostGroupMissingArgumentException(tmp, _name)
self.add_services(kwargs[tmp])
self.parents = []