예제 #1
0
파일: api.py 프로젝트: 40a/jetfire
 def get(self, hostname):
     result = common.getAllGroupsForHost(hostname)
     if result:
         data = {"groups": [host["groupname"] for host in result]}
     else:
         data = {"groups": ""}
     return data
예제 #2
0
 def get(self, hostname):
     result = common.getAllGroupsForHost(hostname)
     if result:
         data = {"groups": [host["groupname"] for host in result]}
     else:
         data = {"groups": ""}
     return data
예제 #3
0
 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
예제 #4
0
파일: get_host.py 프로젝트: 40a/jetfire
 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
예제 #5
0
 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
예제 #6
0
파일: edit_host.py 프로젝트: 40a/jetfire
 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