Merge lp:~cr3/checkbox/environment_plugin into lp:checkbox

Proposed by Marc Tardif
Status: Merged
Merged at revision: 1763
Proposed branch: lp:~cr3/checkbox/environment_plugin
Merge into: lp:checkbox
Diff against target: 51 lines (+11/-13)
2 files modified
debian/changelog (+4/-0)
plugins/environment_info.py (+7/-13)
To merge this branch: bzr merge lp:~cr3/checkbox/environment_plugin
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+129206@code.launchpad.net

Commit message

Merged changes to environment_info for environment to take precedence over configuration files by cr3.

Description of the change

As discussed, enabling the environment to take precedence over configuration files.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Looks OK and the code looks quite simpler. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-10-10 13:45:53 +0000
3+++ debian/changelog 2012-10-11 14:23:26 +0000
4@@ -2,6 +2,10 @@
5
6 * Increased version number after final Ubuntu Quantal release.
7
8+ [Marc Tardif]
9+ * plugins/environment_info.py: Enabling environment to take precedence
10+ over configuration files.
11+
12 -- Daniel Manrique <roadmr@ubuntu.com> Wed, 10 Oct 2012 09:45:08 -0400
13
14 checkbox (0.14.6) quantal; urgency=low
15
16=== modified file 'plugins/environment_info.py'
17--- plugins/environment_info.py 2012-09-20 16:56:31 +0000
18+++ plugins/environment_info.py 2012-10-11 14:23:26 +0000
19@@ -21,6 +21,8 @@
20
21 from checkbox.plugin import Plugin
22 from checkbox.properties import String
23+from checkbox.variables import get_variables
24+
25
26 class EnvironmentInfo(Plugin):
27
28@@ -42,18 +44,10 @@
29 self._manager.reactor.call_on("prompt-begin", self.prompt_begin, 100)
30
31 def prompt_begin(self, interface):
32- os.environ['ROUTERS'] = self.routers
33-
34- os.environ['ROUTER_SSID'] = self.router_ssid
35- os.environ['ROUTER_PSK'] = self.router_psk
36-
37- os.environ['WPA_BG_SSID'] = self.wpa_bg_ssid
38- os.environ['WPA_BG_PSK'] = self.wpa_bg_psk
39- os.environ['OPEN_BG_SSID'] = self.open_bg_ssid
40- os.environ['WPA_N_SSID'] = self.wpa_bg_ssid
41- os.environ['WPA_N_PSK'] = self.wpa_bg_psk
42- os.environ['OPEN_N_SSID'] = self.open_n_ssid
43-
44- os.environ['BTDEVADDR'] = self.btdevaddr
45+ for key, value in get_variables(self).items():
46+ name = key.name.upper()
47+ if name not in os.environ:
48+ os.environ[name] = value.get()
49+
50
51 factory = EnvironmentInfo

Subscribers

People subscribed via source and target branches