Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. is_proxy = device.get('use_as_proxy', '').lower() in ['true', 'false'] or \
  2. device.get('uses_proxy', '').lower() in ['true', 'false']
  3. is_proxy_enabled = device.get('use_as_proxy', '').lower() == 'true' or \
  4. device.get('uses_proxy', '').lower() == 'true'
  5. if is_proxy:
  6. if is_proxy_enabled:
  7. if device.get('use_as_proxy', '').lower() == 'true':
  8. use_as_proxy_device_ips.extend(ips)
  9. else:
  10. proxy_ip = device.get('proxy_ip')
  11. if proxy_ip not in use_as_proxy_device_ips:
  12. validationErrors.append('In row %s: proxy device not found' % ordinal(index))
  13. err = True
  14. proxy_app = self._get_proxy_apps(device, ips, index, ordinal, timezone)
  15. if proxy_app.get('errors'):
  16. validationErrors.extend(proxy_app.get('error_msg'))
  17. err = True
  18. else:
  19. apps.append(proxy_app.get('content'))
  20. else:
  21. err = True
  22. validationErrors.append('In row %s: Invalid Proxy Condition' % ordinal(index))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement