Code review comment for lp://staging/~gary/charms/precise/juju-gui/legacyJujucharms

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

Reviewers: mp+195293_code.launchpad.net,

Message:
Please take a look.

Description:
Sandbox should always use go

On jujucharms, bundle deployment wasn't working because we were using
the python sandbox (because jujucharms still uses pyjuju). Thank you to
Francesco for noticing, diagnosing, and offering a fix. This is his fix
with a quick test.

https://code.launchpad.net/~gary/charms/precise/juju-gui/legacyJujucharms/+merge/195293

(do not edit description out of merge proposal)

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

Affected files (+15, -1 lines):
   A [revision details]
   M hooks/utils.py
   M tests/test_utils.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: hooks/utils.py
=== modified file 'hooks/utils.py'
--- hooks/utils.py 2013-11-13 18:01:03 +0000
+++ hooks/utils.py 2013-11-14 19:10:28 +0000
@@ -420,7 +420,7 @@
      password = password if password else None
      if password is None and ((is_legacy_juju and in_staging) or sandbox):
          password = 'admin'
- api_backend = 'python' if is_legacy_juju else 'go'
+ api_backend = 'python' if (is_legacy_juju and not sandbox) else 'go'
      if secure:
          protocol = 'wss'
      else:

Index: tests/test_utils.py
=== modified file 'tests/test_utils.py'
--- tests/test_utils.py 2013-11-12 12:23:25 +0000
+++ tests/test_utils.py 2013-11-14 19:10:28 +0000
@@ -1059,6 +1059,18 @@
          self.assertIn('password: "kumquat"', js_conf)

      @mock.patch('utils.legacy_juju')
+ def test_write_gui_config_default_sandbox_backend(self,
mock_legacy_juju):
+ mock_legacy_juju.return_value = True
+ write_gui_config(
+ False, 'This is login help.', True, True, self.charmworld_url,
+ self.build_dir, config_js_path='config',
+ password='kumquat', sandbox=True)
+ js_conf = self.files['config']
+ # Because this is sandbox, the apiBackend is always go, even
though it
+ # is legacy_juju.
+ self.assertIn('apiBackend: "go"', js_conf)
+
+ @mock.patch('utils.legacy_juju')
      def test_write_gui_config_default_go_password(self, mock_legacy_juju):
          mock_legacy_juju.return_value = False
          write_gui_config(

« Back to merge proposal