Guest User

Untitled

a guest
Feb 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. def A(X, logger,device_name,ip_address,value_type, value):
  2. result = False
  3. command_string = "my_command %s %s %s" % (ip_address, value, value_type)
  4. logger.debug("%s: command_string = %s", device_name, command_string)
  5. with X:
  6. cmd = Command(command_string)
  7. time.sleep(1.0)
  8. if not cmd.run():
  9. logger.error("%s: cmd.errors = %s", device_name, cmd.errors.rstrip())
  10. elif 'No Such Instance' in cmd.output:
  11. logger.error("%s: cmd.output = %s", device_name, cmd.output.rstrip())
  12. else:
  13. result = True
  14. return result
Add Comment
Please, Sign In to add comment