Question
Misspelled xpath in Palo Alto Panaroma connector in delete_address_object in 7.0.1 release
In the below connector code from operations.py it is observed that the xpath is misspelled as 'xapth' when defining the data variable. My guess is this will never work. This might have been missed as unblock IP action is not the most commonly used action by customers. For one of our use cases the customer requirement was to periodically check the reputation of already marked Malicious Ips and unblock them if they are found to be non-malicious.
def __delete_address_object(self, ip, device_group):
address_name = _format_address_name(ip)
xpath = "/config/devices/entry/device-group/entry[@name='{device_group}']/address/entry[@name='{address_name}']".format(
address_name=address_name, device_group=device_group)
try:
data = {'action': 'delete', 'xapth': xpath}
self.__make_request(data)
except Exception as exp:
logger.debug("Unblocking of IP failed %s" % str(exp))
raise ConnectorError("Failed to unblock the IP %s" % str(exp))
def __delete_address_object(self, ip, device_group):
address_name = _format_address_name(ip)
xpath = "/config/devices/entry/device-group/entry[@name='{device_group}']/address/entry[@name='{address_name}']".format(
address_name=address_name, device_group=device_group)
try:
data = {'action': 'delete', 'xapth': xpath}
self.__make_request(data)
except Exception as exp:
logger.debug("Unblocking of IP failed %s" % str(exp))
raise ConnectorError("Failed to unblock the IP %s" % str(exp))
