Merge lp:~nuclearbob/utah/bug1147306 into lp:utah

Proposed by Max Brustkern
Status: Merged
Merged at revision: 828
Proposed branch: lp:~nuclearbob/utah/bug1147306
Merge into: lp:utah
Diff against target: 44 lines (+11/-2)
2 files modified
debian/changelog (+6/-2)
utah/provisioning/ssh.py (+5/-0)
To merge this branch: bzr merge lp:~nuclearbob/utah/bug1147306
Reviewer Review Type Date Requested Status
Javier Collado (community) Approve
Max Brustkern (community) Needs Resubmitting
Review via email: mp+151806@code.launchpad.net

Description of the change

It looks like the templating change broke the ProvisionedMachine class. This change fixed it for me. We should figure out a good way to add ProvisionedMachine to the regular testing as well.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

Its ugly, but I'm +1 for now. In the future we can hopefully make this more sane by getting the installer logic not bound so tightly to machine.py.

Revision history for this message
Javier Collado (javier.collado) wrote :

Note that for provisioned machines only "install-deb-command.jinja2" is used to
install the client package and that the "add_backslash" filter is only used by
"utah-latecommand-in-target.jinja2". Hence, lines 20-25 in the diff can be removed
since they aren't needed.

We could also have a new module that takes care of the template environment to
avoid the duplication of the filter code, but for now I think that probably
that's an overkill unless we find a case in which the filter code duplication
is really needed.

By the way, for all the other machines there shouldn't be any problem since
ProvisionedMachine is the only machine class that doesn't call the
Machine.__init__ method through chained super calls. In the future, it would be
nice to have a class hierarchy in which the initialization method is reused for
all subclasses.

I need to add provisioned machines to the set of basic tests that I run for
each change to make sure things aren't broken like in this case.

Revision history for this message
Javier Collado (javier.collado) wrote :

One more thing. When the 0.8 version was released, I started the 0.9 version in
changelog in the dev branch and marked it as unreleased. The plan is to to mark
it as released when the changes are merged to trunk.

Anyway, the point I'm trying to make is that I've been adding a description of
all big changes, in particular bug fixes, that have been merged into dev, so
that it's easier to know what's not included yet in the version from trunk.
Hence, please add such a description to changelog. Thanks.

lp:~nuclearbob/utah/bug1147306 updated
828. By Max Brustkern

Removed unneeded extra template method

829. By Max Brustkern

Fixed ProvisionedMachine template support

Revision history for this message
Max Brustkern (nuclearbob) wrote :

I think both of those should be addressed now.

review: Needs Resubmitting
Revision history for this message
Javier Collado (javier.collado) wrote :

Sorry for being picky, but for consistency in other changelog (and bzr log)
entries, I think you should use:
<email address hidden>"
DEBFULLNAME="Max Brustkern"

Also please add "LP: #1147306" to the changelog entry.

lp:~nuclearbob/utah/bug1147306 updated
830. By Max Brustkern

Updated changelog

Revision history for this message
Max Brustkern (nuclearbob) wrote :

I'm not sure why those variables didn't get set, I'll have to check my .bashrc. I updated that manually and added the bug number. Thanks for noticing that.

review: Needs Resubmitting
Revision history for this message
Javier Collado (javier.collado) wrote :

Changes working for me. 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 2013-03-04 14:46:39 +0000
3+++ debian/changelog 2013-03-08 13:53:21 +0000
4@@ -1,12 +1,16 @@
5-utah (0.9ubuntu1) UNRELEASED; urgency=low
6+utah (0.9ubuntu2) UNRELEASED; urgency=low
7
8+ [ Javier Collado ]
9 * Added battery_measurements boolean variable to runlist (defaults to False)
10 * Added success command failure detection (LP: #1126115)
11 * Added installation failure log message (LP: #1126361)
12 * Added check to make sure user is in the password database
13 (LP: #1071020)
14
15- -- Javier Collado <javier.collado@canonical.com> Wed, 27 Feb 2013 09:28:58 +0100
16+ [ Max Brustkern ]
17+ * Fixed ProvisionedMachine template support (LP: #1147306)
18+
19+ -- max <max@canonical.com> Thu, 07 Mar 2013 17:11:12 -0500
20
21 utah (0.8ubuntu1) quantal; urgency=low
22
23
24=== modified file 'utah/provisioning/ssh.py'
25--- utah/provisioning/ssh.py 2013-02-13 15:43:27 +0000
26+++ utah/provisioning/ssh.py 2013-03-08 13:53:21 +0000
27@@ -26,6 +26,8 @@
28
29 from stat import S_ISDIR
30
31+from jinja2 import Environment, FileSystemLoader
32+
33 import utah.timeout
34
35 from utah import config
36@@ -304,6 +306,9 @@
37 if installtype is None:
38 self.installtype = config.installtype
39
40+ self.template_env = \
41+ Environment(loader=FileSystemLoader(config.template_dir))
42+
43 def activecheck(self):
44 """Check if machine is active.
45

Subscribers

People subscribed via source and target branches