def set_proxy_settings(self, config, server, authenticated, username, password, pac_url): config = str(config) or 'System' url = str(server) settings = ProxySettings(config=config) if config == 'Manual': settings.from_url(url) elif config == 'Automatic': settings.pac_url = str(pac_url) settings.authenticated = authenticated settings.username = str(username) settings.password = str(password) return self._manager.set_proxy_settings(settings)
def set_proxy_settings(self, config='System', server=None, authenticated=False, username=None, password=None): try: config = str(config) url = str(server) settings = ProxySettings(config=config) if config == "Manual": settings.from_url(url) settings.authenticated = "true" == authenticated settings.username = str(username) settings.password = str(password) self._manager.set_proxy_settings(settings) except Exception as e: log.exception(e) return ""
def set_proxy_settings(self, config='System', server=None, authenticated=False, username=None, password=None): try: config = str(config) url = str(server) settings = ProxySettings(config=config) if config == "Manual": settings.from_url(url) settings.authenticated = "true" == authenticated settings.username = str(username) settings.password = str(password) return self._manager.set_proxy_settings(settings) except Exception as e: log.exception(e) return ""