original_docstring: Fetch data from configured routers.
  
          Process the fetch queue to identfy fetch events that must be
          processed during this time interval. Store all data received
          to the internal data store through the aggregator module.
  
          The data is fetched using the do_poll.py script run as a
          sub-process. This is not optimal, but we are constrained by the
          fact that the Trigger module, which pulls data from the router
          and the rpki-rtr implementation which pulls data from a rpki-rtr
          manager instance use different event loops. In the future, it
          would probably make sense to modify the rpki-rtr implementation
          to use the Python twisted framework.
  
          Args:
              now: current timestamp
  
          Returns:
              (Boolean, int): A tuple comprising of a pending status and
                              the timestamp for the next event in the queue.
          
docstring: Fetch data from configured routers.
  Process the fetch queue to identfy fetch events that must be
  processed during this time interval. Store all data received
  to the internal data store through the aggregator module.
  
  The data is fetched using the do_poll.py script run as a
  sub-process. This is not optimal, but we are constrained by the
  fact that the Trigger module, which pulls data from the router
  and the rpki-rtr implementation which pulls data from a rpki-rtr
  manager instance use different event loops. In the future, it
  would probably make sense to modify the rpki-rtr implementation
  to use the Python twisted framework.
docstring_tokens: Fetch data from configured routers . Process the fetch queue to identfy fetch events that must be processed during this time interval . Store all data received to the internal data store through the aggregator module . The data is fetched using the do_poll . py script run as a sub - process . This is not optimal but we are constrained by the fact that the Trigger module which pulls data from the router and the rpki - rtr implementation which pulls data from a rpki - rtr manager instance use different event loops . In the future it would probably make sense to modify the rpki - rtr implementation to use the Python twisted framework .
code: def poll(self, now):
          """Fetch data from configured routers.
  
          Process the fetch queue to identfy fetch events that must be
          processed during this time interval. Store all data received
          to the internal data store through the aggregator module.
  
          The data is fetched using the do_poll.py script run as a
          sub-process. This is not optimal, but we are constrained by the
          fact that the Trigger module, which pulls data from the router
          and the rpki-rtr implementation which pulls data from a rpki-rtr
          manager instance use different event loops. In the future, it
          would probably make sense to modify the rpki-rtr implementation
          to use the Python twisted framework.
  
          Args:
              now: current timestamp
  
          Returns:
              (Boolean, int): A tuple comprising of a pending status and
                              the timestamp for the next event in the queue.
          """
          if now - self.last_update > self.poll_interval:
              # Start a fresh lookup
              if self.realm:
                  output = subprocess.check_output(["do_poll.py", "--device", self.device, "--realm", self.realm])
              else:
                  output = subprocess.check_output(["do_poll.py", "--device", self.device])
              #output = subprocess.check_output(["python", "-W ignore", "do_poll.py", "--device", self.device])
              #output = subprocess.check_output(["clogin", "-c 'show ip bgp'", self.device])
              #output = str('{"quagga.vm": {"show ip bgp": "BGP table version is 0, local router ID is 192.168.56.101\\r\\nStatus codes: s suppressed, d damped, h history, * valid, > best, i - internal,\\r\\n              r RIB-failure, S Stale, R Removed\\r\\nOrigin codes: i - IGP, e - EGP, ? - incomplete\\r\\n\\r\\n   Network          Next Hop            Metric LocPrf Weight Path\\r\\n*>i1.9.0.0/16       192.168.56.1            10      0      0 3257 4788 i\\r\\n*>i1.9.21.0/24      192.168.56.1                    0      0 7018 6453 4788 4788 i\\r\\n\\r\\nTotal number of prefixes 2\\r\\n"}}')
              self.ribstate.update(output, now)
              self.last_update = now
  
          # Since we're doing the lookup as a sub-process we're never
          # waiting for data. So the pending status is always false.
          return (False, self.last_update + self.poll_interval)
code_tokens: def poll ( self , now ) : if now - self . last_update > self . poll_interval : if self . realm : output = subprocess . check_output ( [ "do_poll.py" , "--device" , self . device , "--realm" , self . realm ] ) else : output = subprocess . check_output ( [ "do_poll.py" , "--device" , self . device ] ) self . ribstate . update ( output , now ) self . last_update = now return ( False , self . last_update + self . poll_interval )
short_docstring: Fetch data from configured routers.
short_docstring_tokens: Fetch data from configured routers .
comment: """Fetch data from configured routers.
  
          Process the fetch queue to identfy fetch events that must be
          processed during this time interval. Store all data received
          to the internal data store through the aggregator module.
  
          The data is fetched using the do_poll.py script run as a
          sub-process. This is not optimal, but we are constrained by the
          fact that the Trigger module, which pulls data from the router
          and the rpki-rtr implementation which pulls data from a rpki-rtr
          manager instance use different event loops. In the future, it
          would probably make sense to modify the rpki-rtr implementation
          to use the Python twisted framework.
  
          Args:
              now: current timestamp
  
          Returns:
              (Boolean, int): A tuple comprising of a pending status and
                              the timestamp for the next event in the queue.
          """$SEP$# Start a fresh lookup$SEP$#output = subprocess.check_output(["python", "-W ignore", "do_poll.py", "--device", self.device])$SEP$#output = subprocess.check_output(["clogin", "-c 'show ip bgp'", self.device])$SEP$#output = str('{"quagga.vm": {"show ip bgp": "BGP table version is 0, local router ID is 192.168.56.101\\r\\nStatus codes: s suppressed, d damped, h history, * valid, > best, i - internal,\\r\\n              r RIB-failure, S Stale, R Removed\\r\\nOrigin codes: i - IGP, e - EGP, ? - incomplete\\r\\n\\r\\n   Network          Next Hop            Metric LocPrf Weight Path\\r\\n*>i1.9.0.0/16       192.168.56.1            10      0      0 3257 4788 i\\r\\n*>i1.9.21.0/24      192.168.56.1                    0      0 7018 6453 4788 4788 i\\r\\n\\r\\nTotal number of prefixes 2\\r\\n"}}')$SEP$# Since we're doing the lookup as a sub-process we're never$SEP$# waiting for data. So the pending status is always false.