Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. def firewall_device_list_xml():
  2.     firewall_device_list_response = s.post(_csm_server+'configservice/getDeviceListByType', data=firewall_device_list_body)
  3.     firewall_device_list_response_text = firewall_device_list_response.text
  4.     tree = ET.fromstring(firewall_device_list_response_text)
  5.     fwdata = "null"
  6.     for firewall_elemments in tree.findall('.//'):
  7.         for elements in firewall_elemments:
  8.             tag = elements.tag
  9.             text = elements.text
  10.             if tag == "deviceName" and "W2-DEV" in text:
  11.                 fwdata = text
  12.             if tag == "gid" and "W2-DEV" in fwdata:
  13.                 fwdata = fwdata + " : " + text
  14.                 print fwdata
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement