def connect(self): for host in self.hosts: global deviceObjects connectionClass = ConnectionClass(host=host['host'], port=host['port'], protocol=host['protocol']) authenticationClass = AuthenticationClass(username=host['username'], password=host['password']) authenticationClass.get_authentication_token(connectionClass) deviceObjects.append([connectionClass, authenticationClass])
def connect(self): for host in self.hosts: global deviceObjects connectionClass = ConnectionClass(host=host['host'], port=host['port'], protocol=host['protocol']) authenticationClass = AuthenticationClass( username=host['username'], password=host['password']) authenticationClass.get_authentication_token(connectionClass) deviceObjects.append([connectionClass, authenticationClass])
def add_device(host, username, password, port=443, protocol='https'): connectionClass = ConnectionClass(host, port, protocol) authenticationClass = AuthenticationClass(username, password) authenticationClass.get_authentication_token(connectionClass)