Changeset 1196


Ignore:
Timestamp:
12/13/06 13:10:20 (6 years ago)
Author:
mglb1
Message:

Add a function to retreive a list of all hosts that the service is configured
on, even if it is not enabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccsd/trunk/crcnetd/_utils/ccsd_service.py

    r1135 r1196  
    432432        return res[0]["enabled"] 
    433433    
     434    def getHostList(self): 
     435        """Returns a list of hosts that this service is configured on""" 
     436        session = getSessionE(self._session_id) 
     437 
     438        hosts = [] 
     439        res = session.query("SELECT h.host_name, h.host_active FROM " \ 
     440                "service_host sh, host h WHERE sh.host_id=h.host_id " \ 
     441                "AND sh.service_id=%s", (self.service_id)) 
     442        for host in res: 
     443            hosts.append(host["host_name"]) 
     444 
     445        return hosts 
     446 
    434447    def getEnabledHostList(self): 
    435448        """Returns a list of hosts that this service is enabled on""" 
Note: See TracChangeset for help on using the changeset viewer.