Merge lp:~hazmat/pyjuju/custom-branch-fix-path into lp:pyjuju

Proposed by Kapil Thangavelu
Status: Merged
Approved by: Gustavo Niemeyer
Approved revision: 344
Merged at revision: 352
Proposed branch: lp:~hazmat/pyjuju/custom-branch-fix-path
Merge into: lp:pyjuju
Diff against target: 96 lines (+11/-10)
7 files modified
bin/close-port (+1/-1)
bin/config-get (+2/-1)
bin/ensemble-log (+3/-4)
bin/open-port (+1/-1)
bin/relation-get (+2/-1)
bin/relation-list (+1/-1)
bin/relation-set (+1/-1)
To merge this branch: bzr merge lp:~hazmat/pyjuju/custom-branch-fix-path
Reviewer Review Type Date Requested Status
Gustavo Niemeyer Approve
Review via email: mp+75298@code.launchpad.net

Description of the change

extend sys.path instead of replacing to preserve setuptools magic, else we get breakage on hook cli api with custom branches.

To post a comment you must log in.
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Looks good, thanks. Please go ahead and merge it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/close-port'
2--- bin/close-port 2011-08-15 23:56:17 +0000
3+++ bin/close-port 2011-09-14 03:48:23 +0000
4@@ -3,7 +3,7 @@
5 # We avoid using PYTHONPATH because it can cause side effects on hook execution
6 import os, sys
7 if "ENSEMBLE_PYTHONPATH" in os.environ:
8- sys.path[:] = os.environ["ENSEMBLE_PYTHONPATH"].split(":")
9+ sys.path[:0] = filter(None, os.environ["ENSEMBLE_PYTHONPATH"].split(":"))
10
11 from ensemble.hooks.commands import close_port
12
13
14=== modified file 'bin/config-get'
15--- bin/config-get 2011-08-15 23:56:17 +0000
16+++ bin/config-get 2011-09-14 03:48:23 +0000
17@@ -3,7 +3,8 @@
18 # We avoid using PYTHONPATH because it can cause side effects on hook execution
19 import os, sys
20 if "ENSEMBLE_PYTHONPATH" in os.environ:
21- sys.path[:] = os.environ["ENSEMBLE_PYTHONPATH"].split(":")
22+ sys.path[:0] = filter(None, os.environ["ENSEMBLE_PYTHONPATH"].split(":"))
23+
24
25 from ensemble.hooks.commands import config_get
26
27
28=== modified file 'bin/ensemble-log'
29--- bin/ensemble-log 2011-08-10 18:11:35 +0000
30+++ bin/ensemble-log 2011-09-14 03:48:23 +0000
31@@ -1,10 +1,9 @@
32 #!/usr/bin/env python
33
34 # We avoid using PYTHONPATH because it can cause side effects on hook execution
35-import os
36-import sys
37-sys.path.extend(
38- filter(None, os.environ.get("ENSEMBLE_PYTHONPATH", "").split(":")))
39+import os, sys
40+if "ENSEMBLE_PYTHONPATH" in os.environ:
41+ sys.path[:0] = filter(None, os.environ["ENSEMBLE_PYTHONPATH"].split(":"))
42
43 from ensemble.hooks.commands import log
44
45
46=== modified file 'bin/open-port'
47--- bin/open-port 2011-08-15 23:56:17 +0000
48+++ bin/open-port 2011-09-14 03:48:23 +0000
49@@ -3,7 +3,7 @@
50 # We avoid using PYTHONPATH because it can cause side effects on hook execution
51 import os, sys
52 if "ENSEMBLE_PYTHONPATH" in os.environ:
53- sys.path[:] = os.environ["ENSEMBLE_PYTHONPATH"].split(":")
54+ sys.path[:0] = filter(None, os.environ["ENSEMBLE_PYTHONPATH"].split(":"))
55
56 from ensemble.hooks.commands import open_port
57
58
59=== modified file 'bin/relation-get'
60--- bin/relation-get 2011-08-15 23:56:17 +0000
61+++ bin/relation-get 2011-09-14 03:48:23 +0000
62@@ -3,7 +3,8 @@
63 # We avoid using PYTHONPATH because it can cause side effects on hook execution
64 import os, sys
65 if "ENSEMBLE_PYTHONPATH" in os.environ:
66- sys.path[:] = os.environ["ENSEMBLE_PYTHONPATH"].split(":")
67+ sys.path[:0] = filter(None, os.environ["ENSEMBLE_PYTHONPATH"].split(":"))
68+
69
70 from ensemble.hooks.commands import relation_get
71
72
73=== modified file 'bin/relation-list'
74--- bin/relation-list 2011-08-15 23:56:17 +0000
75+++ bin/relation-list 2011-09-14 03:48:23 +0000
76@@ -4,7 +4,7 @@
77 # We avoid using PYTHONPATH because it can cause side effects on hook execution
78 import os, sys
79 if "ENSEMBLE_PYTHONPATH" in os.environ:
80- sys.path[:] = os.environ["ENSEMBLE_PYTHONPATH"].split(":")
81+ sys.path[:0] = filter(None, os.environ["ENSEMBLE_PYTHONPATH"].split(":"))
82
83 from ensemble.hooks.commands import relation_list
84
85
86=== modified file 'bin/relation-set'
87--- bin/relation-set 2011-08-15 23:56:17 +0000
88+++ bin/relation-set 2011-09-14 03:48:23 +0000
89@@ -4,7 +4,7 @@
90 # We avoid using PYTHONPATH because it can cause side effects on hook execution
91 import os, sys
92 if "ENSEMBLE_PYTHONPATH" in os.environ:
93- sys.path[:] = os.environ["ENSEMBLE_PYTHONPATH"].split(":")
94+ sys.path[:0] = filter(None, os.environ["ENSEMBLE_PYTHONPATH"].split(":"))
95
96 from ensemble.hooks.commands import relation_set
97

Subscribers

People subscribed via source and target branches

to status/vote changes: