Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def A(X, logger,device_name,ip_address,value_type, value):
- result = False
- command_string = "my_command %s %s %s" % (ip_address, value, value_type)
- logger.debug("%s: command_string = %s", device_name, command_string)
- with X:
- cmd = Command(command_string)
- time.sleep(1.0)
- if not cmd.run():
- logger.error("%s: cmd.errors = %s", device_name, cmd.errors.rstrip())
- elif 'No Such Instance' in cmd.output:
- logger.error("%s: cmd.output = %s", device_name, cmd.output.rstrip())
- else:
- result = True
- return result
Add Comment
Please, Sign In to add comment