Commit d78f7960 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 12e72ecb
...@@ -5,15 +5,13 @@ sys.path.append({{ repr(buildout_directory_path) }}) ...@@ -5,15 +5,13 @@ sys.path.append({{ repr(buildout_directory_path) }})
from ncclient_common import LopcommNetconfClient from ncclient_common import LopcommNetconfClient
if __name__ == '__main__': if __name__ == '__main__':
nc = LopcommNetconfClient(log_file="{{ log_file }}") nc = LopcommNetconfClient(log_file="{{ log_file }}")
while True: try:
try: nc.connect("{{ netaddr.IPAddress(slap_configuration.get('tap-ipv6-gateway', '')) }}", 830, "oranuser", "oranpassword")
nc.connect("{{ netaddr.IPAddress(slap_configuration.get('tap-ipv6-gateway', '')) }}", 830, "oranuser", "oranpassword") nc.reset_device()
nc.nc.reset_device() nc.logger.info("Device reset successful.")
break except Exception as e:
except Exception as e: nc.logger.debug('Got exception while resetting...')
nc.logger.debug('Got exception, waiting 10 seconds before reconnecting...') nc.logger.debug(e)
nc.logger.debug(e) finally:
time.sleep(10) nc.close()
finally:
nc.close()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment