Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Device_optimiser():
- @staticmethod
- def connector(**args):
- ssh_client = paramiko.SSHClient()
- for i in args["devices"]:
- try:
- ssh_client.connect(hostname= i['host'],
- username=args['username'],
- password=args['password'],
- port = 22)
- except Exception:
- ll.error("bad device")
- stdin, stdout, stderr = ssh_client.exec_command(i['command'])
- return stdout.read()
- @staticmethod
- def parser(msg):
- parsed_msg = msg + "some work"
- return parsed_msg
- @staticmethod
- def algorithm(parsed_msg):
- sort_selected_msg = parsed_msg + "some work"
- return sort_selected_msg
- @classmethod
- def main(cls, info):
- ssh_output = Device_optimiser.connector(**info)
- parsed_output = Device_optimiser.parser(ssh_output)
- Device_optimiser.algorithm(parsed_output)
- Device_optimiser.connector(**info)
Add Comment
Please, Sign In to add comment