Merge lp:~frankban/charms/precise/juju-gui/install-yaml into lp:~juju-gui/charms/precise/juju-gui/trunk

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 127
Proposed branch: lp:~frankban/charms/precise/juju-gui/install-yaml
Merge into: lp:~juju-gui/charms/precise/juju-gui/trunk
Diff against target: 145 lines (+28/-25)
6 files modified
hooks/backend.py (+1/-2)
hooks/install (+10/-6)
hooks/utils.py (+12/-12)
revision (+1/-1)
server-requirements.pip (+2/-0)
tests/test_backends.py (+2/-4)
To merge this branch: bzr merge lp:~frankban/charms/precise/juju-gui/install-yaml
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+195113@code.launchpad.net

Description of the change

Fix base Python dependencies.

The install hook imported charmhelpers
before installing python-yaml, and
charmhelpers imports from yaml.

This very old bug has been hidden by the
fact that python-yaml is automatically
installed in ec2/lxc instances, but showed
itself when using the manual provider.

Copy/pasting and integrating the QA from
my last branch, a double check can help
before the release.
QA:
- Bootstrap a Juju environment with --debug.
- Deploy and expose the GUI (make deploy).
- Check juju debug-log (or
  less ~/.juju/local/log/unit-juju-gui-0.log if you
  used lxc): you should see the following message
  at the beginning of the install hook log:
  "Installing base Python dependencies: python-apt,
  python-launchpadlib, python-tempita, python-yaml."
- Wait for the GUI to be ready/started.
- Deploy this bundle: http://pastebin.ubuntu.com/6411548/
- Check everything is ok, xy annotations work (
  the services are vertically aligned), wordpress has
  customized constraints, mysql customized options and
  two units.
- No try to deploy the same bundle again, you
  will see a "services already there" kind of error.

https://codereview.appspot.com/26190043/

To post a comment you must log in.
Revision history for this message
Francesco Banconi (frankban) wrote :
Download full text (5.9 KiB)

Reviewers: mp+195113_code.launchpad.net,

Message:
Please take a look.

Description:
Fix base Python dependencies.

The install hook imported charmhelpers
before installing python-yaml, and
charmhelpers imports from yaml.

This very old bug has been hidden by the
fact that python-yaml is automatically
installed in ec2/lxc instances, but showed
itself when using the manual provider.

Copy/pasting and integrating the QA from
my last branch, a double check can help
before the release.
QA:
- Bootstrap a Juju environment with --debug.
- Deploy and expose the GUI (make deploy).
- Check juju debug-log (or
   less ~/.juju/local/log/unit-juju-gui-0.log if you
   used lxc): you should see the following message
   at the beginning of the install hook log:
   "Installing base Python dependencies: python-apt,
   python-launchpadlib, python-tempita, python-yaml."
- Wait for the GUI to be ready/started.
- Deploy this bundle: http://pastebin.ubuntu.com/6411548/
- Check everything is ok, xy annotations work (
   the services are vertically aligned), wordpress has
   customized constraints, mysql customized options and
   two units.
- No try to deploy the same bundle again, you
   will see a "services already there" kind of error.

https://code.launchpad.net/~frankban/charms/precise/juju-gui/install-yaml/+merge/195113

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/26190043/

Affected files (+30, -25 lines):
   A [revision details]
   M hooks/backend.py
   M hooks/install
   M hooks/utils.py
   M revision
   M server-requirements.pip
   M tests/test_backends.py

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision:
<email address hidden>

Index: revision
=== modified file 'revision'
--- revision 2013-11-13 16:36:02 +0000
+++ revision 2013-11-13 18:01:03 +0000
@@ -1,1 +1,1 @@
-97
+98

Index: server-requirements.pip
=== modified file 'server-requirements.pip'
--- server-requirements.pip 2013-11-13 17:45:50 +0000
+++ server-requirements.pip 2013-11-13 18:01:03 +0000
@@ -18,6 +18,8 @@

  # Note: the order of the following dependencies is important! The last ones
  # depends on the previous.
+# The python-bzrlib and python-yaml dependencies are installed using apt in
+# the charm hooks.

  futures==2.1.4
  tornado==3.1.1

Index: hooks/backend.py
=== modified file 'hooks/backend.py'
--- hooks/backend.py 2013-10-08 07:46:11 +0000
+++ hooks/backend.py 2013-11-13 18:01:03 +0000
@@ -106,8 +106,7 @@

  class GoMixin(object):
      """Manage the real Go juju-core backend."""
-
- debs = ('python-yaml',)
+ pass

  class GuiMixin(object):

Index: hooks/install
=== modified file 'hooks/install'
--- hooks/install 2013-10-07 14:45:00 +0000
+++ hooks/install 2013-11-13 18:01:03 +0000
@@ -20,10 +20,6 @@
  import errno
  import os

-from charmhelpers import (
- get_config,
- log,
-)
  from shelltoolbox import (
      apt_get_install,
      run,
@@ -32,1...

Read more...

129. By Francesco Banconi

Fix typo.

Revision history for this message
Francesco Banconi (frankban) wrote :
Revision history for this message
Gary Poster (gary) wrote :
Revision history for this message
Francesco Banconi (frankban) wrote :

*** Submitted:

Fix base Python dependencies.

The install hook imported charmhelpers
before installing python-yaml, and
charmhelpers imports from yaml.

This very old bug has been hidden by the
fact that python-yaml is automatically
installed in ec2/lxc instances, but showed
itself when using the manual provider.

Copy/pasting and integrating the QA from
my last branch, a double check can help
before the release.
QA:
- Bootstrap a Juju environment with --debug.
- Deploy and expose the GUI (make deploy).
- Check juju debug-log (or
   less ~/.juju/local/log/unit-juju-gui-0.log if you
   used lxc): you should see the following message
   at the beginning of the install hook log:
   "Installing base Python dependencies: python-apt,
   python-launchpadlib, python-tempita, python-yaml."
- Wait for the GUI to be ready/started.
- Deploy this bundle: http://pastebin.ubuntu.com/6411548/
- Check everything is ok, xy annotations work (
   the services are vertically aligned), wordpress has
   customized constraints, mysql customized options and
   two units.
- No try to deploy the same bundle again, you
   will see a "services already there" kind of error.

R=gary.poster
CC=
https://codereview.appspot.com/26190043

https://codereview.appspot.com/26190043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/backend.py'
--- hooks/backend.py 2013-10-08 07:46:11 +0000
+++ hooks/backend.py 2013-11-13 18:37:19 +0000
@@ -106,8 +106,7 @@
106106
107class GoMixin(object):107class GoMixin(object):
108 """Manage the real Go juju-core backend."""108 """Manage the real Go juju-core backend."""
109109 pass
110 debs = ('python-yaml',)
111110
112111
113class GuiMixin(object):112class GuiMixin(object):
114113
=== modified file 'hooks/install'
--- hooks/install 2013-10-07 14:45:00 +0000
+++ hooks/install 2013-11-13 18:37:19 +0000
@@ -20,10 +20,6 @@
20import errno20import errno
21import os21import os
2222
23from charmhelpers import (
24 get_config,
25 log,
26)
27from shelltoolbox import (23from shelltoolbox import (
28 apt_get_install,24 apt_get_install,
29 run,25 run,
@@ -32,13 +28,21 @@
3228
33# Python dependencies must be installed here so that the charm can import and29# Python dependencies must be installed here so that the charm can import and
34# use required libraries.30# use required libraries.
35PYTHON_DEPENDENCIES = ('python-apt', 'python-launchpadlib', 'python-tempita')31PYTHON_DEPENDENCIES = (
32 'python-apt', 'python-launchpadlib', 'python-tempita', 'python-yaml')
3633
37log('Installing base Python dependnecies: {}.'.format(34run('juju-log', '--', 'Installing base Python dependencies: {}.'.format(
38 ', '.join(PYTHON_DEPENDENCIES)))35 ', '.join(PYTHON_DEPENDENCIES)))
39apt_get_install(*PYTHON_DEPENDENCIES)36apt_get_install(*PYTHON_DEPENDENCIES)
4037
4138
39# The charmhelpers module depends on python-yaml and must be imported only
40# after the installation of the Python dependencies above.
41from charmhelpers import (
42 get_config,
43 log,
44)
45
42from utils import (46from utils import (
43 config_json,47 config_json,
44 log_hook,48 log_hook,
4549
=== modified file 'hooks/utils.py'
--- hooks/utils.py 2013-11-12 12:23:25 +0000
+++ hooks/utils.py 2013-11-13 18:37:19 +0000
@@ -74,11 +74,20 @@
74import urlparse74import urlparse
7575
76import apt76import apt
77from launchpadlib.launchpad import Launchpad
77import tempita78import tempita
79import yaml
7880
79from launchpadlib.launchpad import Launchpad81from charmhelpers import (
82 get_config,
83 log,
84 RESTART,
85 service_control,
86 START,
87 STOP,
88 unit_get,
89)
80from shelltoolbox import (90from shelltoolbox import (
81 Serializer,
82 apt_get_install,91 apt_get_install,
83 command,92 command,
84 environ,93 environ,
@@ -86,17 +95,9 @@
86 run,95 run,
87 script_name,96 script_name,
88 search_file,97 search_file,
98 Serializer,
89 su,99 su,
90)100)
91from charmhelpers import (
92 RESTART,
93 START,
94 STOP,
95 get_config,
96 log,
97 service_control,
98 unit_get,
99)
100101
101102
102AGENT = 'juju-api-agent'103AGENT = 'juju-api-agent'
@@ -173,7 +174,6 @@
173 # The JUJU_API_ADDRESSES environment variable is not included in the hooks174 # The JUJU_API_ADDRESSES environment variable is not included in the hooks
174 # context in older releases of juju-core. Retrieve it from the machiner175 # context in older releases of juju-core. Retrieve it from the machiner
175 # agent file instead.176 # agent file instead.
176 import yaml # python-yaml is only installed if juju-core is used.
177 if unit_dir is None:177 if unit_dir is None:
178 base_dir = os.path.join(CURRENT_DIR, '..', '..')178 base_dir = os.path.join(CURRENT_DIR, '..', '..')
179 else:179 else:
180180
=== modified file 'revision'
--- revision 2013-11-13 16:36:02 +0000
+++ revision 2013-11-13 18:37:19 +0000
@@ -1,1 +1,1 @@
197198
22
=== modified file 'server-requirements.pip'
--- server-requirements.pip 2013-11-13 17:45:50 +0000
+++ server-requirements.pip 2013-11-13 18:37:19 +0000
@@ -18,6 +18,8 @@
1818
19# Note: the order of the following dependencies is important! The last ones19# Note: the order of the following dependencies is important! The last ones
20# depends on the previous.20# depends on the previous.
21# The python-bzrlib and python-yaml dependencies are installed using apt in
22# the charm hooks.
2123
22futures==2.1.424futures==2.1.4
23tornado==3.1.125tornado==3.1.1
2426
=== modified file 'tests/test_backends.py'
--- tests/test_backends.py 2013-10-07 14:17:11 +0000
+++ tests/test_backends.py 2013-11-13 18:37:19 +0000
@@ -33,12 +33,10 @@
3333
3434
35EXPECTED_PYTHON_LEGACY_DEBS = ('apache2', 'curl', 'haproxy', 'openssl')35EXPECTED_PYTHON_LEGACY_DEBS = ('apache2', 'curl', 'haproxy', 'openssl')
36EXPECTED_GO_LEGACY_DEBS = (36EXPECTED_GO_LEGACY_DEBS = ('apache2', 'curl', 'haproxy', 'openssl')
37 'apache2', 'curl', 'haproxy', 'openssl', 'python-yaml')
38EXPECTED_PYTHON_BUILTIN_DEBS = (37EXPECTED_PYTHON_BUILTIN_DEBS = (
39 'curl', 'openssl', 'python-bzrlib', 'python-pip')38 'curl', 'openssl', 'python-bzrlib', 'python-pip')
40EXPECTED_GO_BUILTIN_DEBS = (39EXPECTED_GO_BUILTIN_DEBS = ('curl', 'openssl', 'python-bzrlib', 'python-pip')
41 'curl', 'openssl', 'python-bzrlib', 'python-pip', 'python-yaml')
4240
43simulate_pyjuju = mock.patch('utils.legacy_juju', mock.Mock(return_value=True))41simulate_pyjuju = mock.patch('utils.legacy_juju', mock.Mock(return_value=True))
44simulate_juju_core = mock.patch(42simulate_juju_core = mock.patch(

Subscribers

People subscribed via source and target branches