Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. from jnpr.junos import Device
  2. from jnpr.junos.utils.config import Config
  3.  
  4. dev = Device('juniper.device.example.com', user='netconf-user',
  5. password='some-pass', port=22, gather_facts=True)
  6. dev.open()
  7.  
  8. cu = Config(dev)
  9. try:
  10. cu.lock()
  11. except:
  12. print 'Unable to lock'
  13.  
  14. try:
  15. load_args = {'path': './test.set'}
  16. cu.load(**load_args)
  17. except Exception as e:
  18. print 'Exception'
  19. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement