Merge lp:~xnox/system-service/pac-support into lp:system-service

Proposed by Dimitri John Ledkov
Status: Needs review
Proposed branch: lp:~xnox/system-service/pac-support
Merge into: lp:system-service
Prerequisite: lp:~xnox/system-service/python3
Diff against target: 71 lines (+13/-11)
3 files modified
UbuntuSystemService/backend.py (+9/-9)
debian/changelog (+3/-1)
test/interactive/test_dbus (+1/-1)
To merge this branch: bzr merge lp:~xnox/system-service/pac-support
Reviewer Review Type Date Requested Status
Iain Lane Needs Fixing
Michael Vogt Pending
Martin Pitt Pending
Review via email: mp+243904@code.launchpad.net

This proposal supersedes a proposal from 2014-12-07.

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

Thanks, but there are conflicts with trunk, please resolve.

review: Needs Fixing

Unmerged revisions

77. By Dimitri John Ledkov

Add support for auto_proxy (Proxy auto-config)

76. By Dimitri John Ledkov

Clean-up unused imports

75. By Dimitri John Ledkov

port system-service-d to python3.

74. By Dimitri John Ledkov

Port to python3.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UbuntuSystemService/backend.py'
2--- UbuntuSystemService/backend.py 2014-12-07 02:13:29 +0000
3+++ UbuntuSystemService/backend.py 2014-12-07 02:13:29 +0000
4@@ -17,7 +17,7 @@
5
6 # some class properties
7 DBUS_INTERFACE_NAME = "com.ubuntu.SystemService"
8- SUPPORTED_PROXIES = ("http","ftp", "https", "socks")
9+ SUPPORTED_PROXIES = ("http","ftp", "https", "socks", "auto")
10
11 # default files
12 DPKG_LOCK = "/var/lib/dpkg/lock"
13@@ -79,6 +79,11 @@
14 env_proxy = self._etc_environment_proxy("https")
15 return env_proxy
16
17+ def _auto_proxy(self):
18+ " internal helper that returns the current auto proxy "
19+ env_proxy = self._etc_environment_proxy("auto")
20+ return env_proxy
21+
22 def _verify_proxy(self, proxy_type, proxy):
23 " internal helper, verify that the proxy string is valid "
24 return verify_proxy(proxy_type, proxy)
25@@ -99,14 +104,9 @@
26 This function will look in the apt configuration to
27 find the current http proxy.
28 """
29- if proxy_type == "http":
30- return self._http_proxy()
31- if proxy_type == "https":
32- return self._https_proxy()
33- elif proxy_type == "ftp":
34- return self._ftp_proxy()
35- elif proxy_type == "socks":
36- return self._socks_proxy()
37+ proxy_method = getattr(self, "_%s_proxy" % proxy_type, False)
38+ if proxy_method:
39+ return proxy_method()
40 raise UnknownProxyTypeError("proxy_type '%s' is unknown in get_proxy" % proxy_type)
41
42
43
44=== modified file 'debian/changelog'
45--- debian/changelog 2014-12-07 02:13:29 +0000
46+++ debian/changelog 2014-12-07 02:13:29 +0000
47@@ -1,8 +1,10 @@
48 ubuntu-system-service (0.3.0) UNRELEASED; urgency=low
49
50+ [ Dimitri John Ledkov ]
51 * Port to python3.
52+ * Add support for auto_proxy (Proxy auto-config)
53
54- -- Dmitrijs Ledkovs <xnox@ubuntu.com> Sun, 27 Oct 2013 01:35:30 +0000
55+ -- Dimitri John Ledkov <dimitri.j.ledkov@intel.com> Sun, 27 Oct 2013 01:35:30 +0000
56
57 ubuntu-system-service (0.2.5) saucy; urgency=low
58
59
60=== modified file 'test/interactive/test_dbus'
61--- test/interactive/test_dbus 2011-10-21 16:48:31 +0000
62+++ test/interactive/test_dbus 2014-12-07 02:13:29 +0000
63@@ -23,7 +23,7 @@
64 self.assertTrue( res in [True, False] )
65
66 def test_get_proxy(self):
67- for proto in ["http", "https", "ftp"]:
68+ for proto in ["http", "https", "ftp", "auto"]:
69 res = self.iface.get_proxy(proto)
70 # ensure we get a string
71 self.assertTrue( isinstance(res, dbus.String) )

Subscribers

People subscribed via source and target branches