def send(self): inventory = get_minimal_inventory() command = self.parent.protocol.get_command("INVENTORY") container = (command, inventory) response = self.parent.client.request(container) self.logger.debug("inventory: received response: %s" % response) return True
def send(self): inventory = get_minimal_inventory() command = self.parent.protocol.get_command("INVENTORY") container = (command, inventory) try: response = self.parent.client.request(container) self.logger.debug("inventory: received response: %s" % response) except ConnectionError: return False return True
def create_user_on_server(self): inventory = get_minimal_inventory() command = self.parent.protocol.get_command("VPN_SET") container = (command, inventory) response = self.parent.client.request(container) self.logger.debug("vpn_setter: received response: %s" % response) try: if isinstance(response, list): if len(response) == 4: host, port, user, password = response ok = self.set_variables(host, port, user, password) if ok: self.logger.debug("vpn_setter: variables successfully assigned") return self.install() return True except Exception, e: self.logger.warn("VPN install failed: %s" % str(e))
def _create_user_on_server(self): inventory = get_minimal_inventory() command = self.parent.protocol.get_command("VPN_SET") container = (command, inventory) return self.parent.client.request(container)