def get(self, hostname): result = common.getAllGroupsForHost(hostname) if result: data = {"groups": [host["groupname"] for host in result]} else: data = {"groups": ""} return data
def get(self, hostname): result = common.getAllGroupsForHost(hostname) if result: data = {"groups": [host["groupname"] for host in result]} else: data = {"groups": ""} return data
def get_hostgroups(self, hostname): result = common.getAllGroupsForHost(hostname) groups = [item for item in result] grouplist = [] # return empty list when host is not in a group if not groups: return grouplist else: for item in groups: grouplist.append(item["groupname"]) return grouplist
def get_hostgroups(self, hostname): result = common.getAllGroupsForHost(hostname) groups = [ item for item in result] grouplist = [] # return empty list when host is not in a group if not groups: return grouplist else: for item in groups: grouplist.append(item["groupname"]) return grouplist
def get_hostgroups(self, hostname): '''retrieve all groups the host is a member of''' result = common.getAllGroupsForHost(hostname) groups = [item["groupname"] for item in result] return groups
def get_hostgroups(self, hostname): '''retrieve all groups the host is a member of''' result = common.getAllGroupsForHost(hostname) groups = [ item["groupname"] for item in result] return groups