Merge lp:~bcsaller/charm-tools/fix-deps-again into lp:charm-tools/1.6

Proposed by Marco Ceppi
Status: Merged
Merged at revision: 363
Proposed branch: lp:~bcsaller/charm-tools/fix-deps-again
Merge into: lp:charm-tools/1.6
Diff against target: 130 lines (+28/-12)
6 files modified
charmtools/compose/__init__.py (+1/-1)
charmtools/compose/tactics.py (+18/-8)
charmtools/fetchers.py (+6/-1)
tests/test_compose.py (+0/-2)
tests_functional/create/test_ansible_create.py (+1/-0)
tests_functional/create/test_python_create.py (+2/-0)
To merge this branch: bzr merge lp:~bcsaller/charm-tools/fix-deps-again
Reviewer Review Type Date Requested Status
Tim Van Steenburgh (community) Approve
Review via email: mp+270089@code.launchpad.net
To post a comment you must log in.
364. By Benjamin Saller

fix tests, pip arguments changed

365. By Benjamin Saller

func test fallout, unrelated chagnes in CH

Revision history for this message
Benjamin Saller (bcsaller) wrote :

I'd thought this was merged, people are still seeing issues related to this.

Revision history for this message
Tim Van Steenburgh (tvansteenburgh) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmtools/compose/__init__.py'
2--- charmtools/compose/__init__.py 2015-08-27 19:13:01 +0000
3+++ charmtools/compose/__init__.py 2015-09-03 17:47:51 +0000
4@@ -379,7 +379,7 @@
5 "Changes will be overwritten")
6 else:
7 raise ValueError(
8- "Unable to continue due to unexpected modifications")
9+ "Unable to continue due to unexpected modifications (try --force)")
10 return a, c, d
11
12 def __call__(self):
13
14=== modified file 'charmtools/compose/tactics.py'
15--- charmtools/compose/tactics.py 2015-08-27 19:13:01 +0000
16+++ charmtools/compose/tactics.py 2015-09-03 17:47:51 +0000
17@@ -406,26 +406,36 @@
18 utils.Process(("pip",
19 "install",
20 "-U",
21- "--exists-action",
22- "i",
23 "-t",
24 temp_dir,
25 spec)).throw_on_error()()
26 dirs = temp_dir.listdir()
27 self._tracked = []
28 for d in dirs:
29- d.move(target)
30- self._tracked.append(target / d)
31+ d = d.relpath(temp_dir)
32+ dst = target / d
33+ if dst.exists():
34+ if dst.isdir():
35+ dst.rmtree_p()
36+ elif dst.isfile():
37+ dst.remove()
38+ d.move(dst)
39+ self._tracked.append(dst)
40
41 def sign(self):
42 """return sign in the form {relpath: (origin layer, SHA256)}
43 """
44 sigs = {}
45 for d in self._tracked:
46- for entry, sig in utils.walk(d,
47- utils.sign, kind="files"):
48- relpath = entry.relpath(self._target.directory)
49- sigs[relpath] = (self.current.url, "dynamic", sig)
50+ if d.isdir():
51+ for entry, sig in utils.walk(d,
52+ utils.sign, kind="files"):
53+ relpath = entry.relpath(self.target.directory)
54+ sigs[relpath] = (self.current.url, "dynamic", sig)
55+ elif d.isfile():
56+ relpath = d.relpath(self.target.directory)
57+ sigs[relpath] = (
58+ self.current.url, "dynamic", utils.sign(d))
59 return sigs
60
61
62
63=== modified file 'charmtools/fetchers.py'
64--- charmtools/fetchers.py 2015-09-01 21:19:06 +0000
65+++ charmtools/fetchers.py 2015-09-03 17:47:51 +0000
66@@ -40,7 +40,12 @@
67 if not name:
68 return dir_
69 new_dir = os.path.join(os.path.dirname(dir_), name)
70- os.rename(dir_, new_dir)
71+ if not os.path.exists(new_dir):
72+ # This ignores existing repos
73+ # In truth we want control over management of existing
74+ # repos with per VCS branch selections
75+ # ex: switching the git branch marked in revision
76+ os.rename(dir_, new_dir)
77 return new_dir
78
79
80
81=== modified file 'tests/test_compose.py'
82--- tests/test_compose.py 2015-08-27 19:13:01 +0000
83+++ tests/test_compose.py 2015-09-03 17:47:51 +0000
84@@ -211,7 +211,6 @@
85
86 # show that we pulled charmhelpers from the basic layer as well
87 mcall.assert_called_with(("pip", "install", "-U",
88- '--exists-action', 'i',
89 "-t", mock.ANY,
90 mock.ANY))
91
92@@ -229,7 +228,6 @@
93 composer.PHASES = composer.PHASES[:-2]
94 composer()
95 mcall.assert_called_with(("pip", "install", "-U",
96- '--exists-action', 'i',
97 "-t", mock.ANY,
98 "charmhelpers"))
99
100
101=== modified file 'tests_functional/create/test_ansible_create.py'
102--- tests_functional/create/test_ansible_create.py 2015-08-20 13:31:58 +0000
103+++ tests_functional/create/test_ansible_create.py 2015-09-03 17:47:51 +0000
104@@ -68,6 +68,7 @@
105 'lib/charmhelpers/core/hookenv.py',
106 'lib/charmhelpers/core/host.py',
107 'lib/charmhelpers/core/hugepage.py',
108+ 'lib/charmhelpers/core/kernel.py',
109 'lib/charmhelpers/core/services/__init__.py',
110 'lib/charmhelpers/core/services/base.py',
111 'lib/charmhelpers/core/services/helpers.py',
112
113=== modified file 'tests_functional/create/test_python_create.py'
114--- tests_functional/create/test_python_create.py 2015-08-20 13:31:58 +0000
115+++ tests_functional/create/test_python_create.py 2015-09-03 17:47:51 +0000
116@@ -1,5 +1,6 @@
117 #!/usr/bin/python
118
119+
120 # Copyright (C) 2014 Canonical Ltd.
121 #
122 # This program is free software: you can redistribute it and/or modify
123@@ -59,6 +60,7 @@
124 'lib/charmhelpers/core/hookenv.py',
125 'lib/charmhelpers/core/host.py',
126 'lib/charmhelpers/core/hugepage.py',
127+ 'lib/charmhelpers/core/kernel.py',
128 'lib/charmhelpers/core/services/__init__.py',
129 'lib/charmhelpers/core/services/base.py',
130 'lib/charmhelpers/core/services/helpers.py',

Subscribers

People subscribed via source and target branches