Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- is_proxy = device.get('use_as_proxy', '').lower() in ['true', 'false'] or \
- device.get('uses_proxy', '').lower() in ['true', 'false']
- is_proxy_enabled = device.get('use_as_proxy', '').lower() == 'true' or \
- device.get('uses_proxy', '').lower() == 'true'
- if is_proxy:
- if is_proxy_enabled:
- if device.get('use_as_proxy', '').lower() == 'true':
- use_as_proxy_device_ips.extend(ips)
- else:
- proxy_ip = device.get('proxy_ip')
- if proxy_ip not in use_as_proxy_device_ips:
- validationErrors.append('In row %s: proxy device not found' % ordinal(index))
- err = True
- proxy_app = self._get_proxy_apps(device, ips, index, ordinal, timezone)
- if proxy_app.get('errors'):
- validationErrors.extend(proxy_app.get('error_msg'))
- err = True
- else:
- apps.append(proxy_app.get('content'))
- else:
- err = True
- validationErrors.append('In row %s: Invalid Proxy Condition' % ordinal(index))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement