JunOS: Add alive function to proxy

New in Nitrogen is a proxy_keep_alive option to poll the connection
periodicaly to keep it alive.  This is predicated on having an alive function
in the proxy code to see if the connection still exists.  This code
implements the alive function so that the proxy_keep_alive can work.
This commit is contained in:
Jeremy McDermond 2017-05-16 15:40:59 -07:00
parent 97baddaa10
commit 10e51e4367

View File

@ -116,6 +116,15 @@ def conn():
return thisproxy['conn']
def alive(opts):
'''
Return the connection status with the remote device.
.. versionadded:: Oxygen
'''
return thisproxy['conn'].connected
def proxytype():
'''
Returns the name of this proxy