Commit d78f7960 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 12e72ecb
...@@ -6,14 +6,12 @@ from ncclient_common import LopcommNetconfClient ...@@ -6,14 +6,12 @@ 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.nc.reset_device() nc.reset_device()
break nc.logger.info("Device reset successful.")
except Exception as e: except Exception as e:
nc.logger.debug('Got exception, waiting 10 seconds before reconnecting...') nc.logger.debug('Got exception while resetting...')
nc.logger.debug(e) nc.logger.debug(e)
time.sleep(10)
finally: finally:
nc.close() 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