Changeset 1507
- Timestamp:
- Feb 18, 2014 12:09:54 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
topdoc/trunk/src/bcda/ask_alive.py
r1506 r1507 3 3 '''ask_alive: get BCDA IOC information 4 4 5 On the APS internal network, query the BCDA alive support5 On the APS internal network, query the BCDA alive record service 6 6 for recent information about the status of known IOCs. 7 8 EXAMPLE:: 9 10 from bcda.ask_alive import identify_iocs 11 known_ioc_dict = identify_iocs() # get a dictionary of known IOCs from "alive" 12 for name in known_ioc_dict.keys(): 13 print name, known_ioc_dict[name].alive 14 7 15 ''' 8 16 … … 22 30 self.name = '' 23 31 self.address = '' 24 self.timer = ''32 self.timer = 0 25 33 self.uptime = '' 26 34 self.downtime = '' 35 self.alive = False 27 36 self.env = dict(ARCH='', TOP='', EPICS_BASE='', 28 37 SUPPORT='', LOCATION='', ENGINEER='') … … 43 52 self.env[key] = value 44 53 54 self.alive = self.timer < TIMER_THRESHOLD_DEAD_IOC 55 45 56 def subnode_text(self, node, subnode_tag): 46 57 '''return the text from the named subnode''' … … 56 67 '''read all the IOCs from the XML document, return as {name:Ioc()}''' 57 68 doc = etree.parse(xml_source) 58 version = doc.getroot().get('version', UNVERSIONED_XML) 69 root = doc.getroot() 70 version = root.get('version', UNVERSIONED_XML) 59 71 if version not in (UNVERSIONED_XML): 60 72 raise RuntimeError, 'unexpected version: ' + version … … 79 91 c += 1 80 92 row = [c, k, ioc.address,] 81 if ioc. timer < TIMER_THRESHOLD_DEAD_IOC:93 if ioc.alive: 82 94 row.append(ioc.uptime) 83 95 else:
Note: See TracChangeset
for help on using the changeset viewer.