Merge lp:~frankban/juju-quickstart/prepare-new-release into lp:juju-quickstart

Proposed by Francesco Banconi
Status: Merged
Merged at revision: 54
Proposed branch: lp:~frankban/juju-quickstart/prepare-new-release
Merge into: lp:juju-quickstart
Diff against target: 354 lines (+96/-71)
9 files modified
HACKING.rst (+5/-0)
quickstart/__init__.py (+2/-2)
quickstart/app.py (+22/-2)
quickstart/manage.py (+2/-11)
quickstart/settings.py (+3/-3)
quickstart/tests/test_app.py (+52/-5)
quickstart/tests/test_manage.py (+8/-14)
quickstart/tests/test_utils.py (+1/-24)
quickstart/utils.py (+1/-10)
To merge this branch: bzr merge lp:~frankban/juju-quickstart/prepare-new-release
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+207145@code.launchpad.net

Description of the change

Minor changes in preparation for release.

Bump version up to 1.1.0.
Re-organize the "requires sudo" code.
Restore 100% unit test coverage (compulsive mode on).
Update license headers of modified files.

Tests: `make check`
QA: use quickstart as usual, bootstrapping
both ec2 and local environments.

https://codereview.appspot.com/65970043/

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

Reviewers: mp+207145_code.launchpad.net,

Message:
Please take a look.

Description:
Minor changes in preparation for release.

Bump version up to 1.1.0.
Re-organize the "requires sudo" code.
Restore 100% unit test coverage (compulsive mode on).
Update license headers of modified files.

Tests: `make check`
QA: use quickstart as usual, bootstrapping
both ec2 and local environments.

https://code.launchpad.net/~frankban/juju-quickstart/prepare-new-release/+merge/207145

(do not edit description out of merge proposal)

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

Affected files (+93, -71 lines):
   A [revision details]
   M quickstart/__init__.py
   M quickstart/app.py
   M quickstart/manage.py
   M quickstart/settings.py
   M quickstart/tests/test_app.py
   M quickstart/tests/test_manage.py
   M quickstart/tests/test_utils.py
   M quickstart/utils.py

Revision history for this message
Richard Harding (rharding) wrote :

LGTM with the one note on potential room for a docs update.

Will QA.

https://codereview.appspot.com/65970043/diff/1/quickstart/manage.py
File quickstart/manage.py (right):

https://codereview.appspot.com/65970043/diff/1/quickstart/manage.py#newcode392
quickstart/manage.py:392: requires_sudo =
app.bootstrap_requires_sudo(is_local)
yay for functions that can be tested in isolation.

https://codereview.appspot.com/65970043/diff/1/quickstart/settings.py
File quickstart/settings.py (right):

https://codereview.appspot.com/65970043/diff/1/quickstart/settings.py#newcode35
quickstart/settings.py:35: JUJU_DEFAULT_SERIES = ('precise', 'quantal',
'raring', 'saucy', 'trusty')
good call, are these tweaks needed to keep it up to date noted? Maybe a
releases section in the hacking doc can note to check the latest charm
version and such?

https://codereview.appspot.com/65970043/

Revision history for this message
Richard Harding (rharding) wrote :
55. By Francesco Banconi

Changes as per review.

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

*** Submitted:

Minor changes in preparation for release.

Bump version up to 1.1.0.
Re-organize the "requires sudo" code.
Restore 100% unit test coverage (compulsive mode on).
Update license headers of modified files.

Tests: `make check`
QA: use quickstart as usual, bootstrapping
both ec2 and local environments.

R=rharding
CC=
https://codereview.appspot.com/65970043

https://codereview.appspot.com/65970043/diff/1/quickstart/settings.py
File quickstart/settings.py (right):

https://codereview.appspot.com/65970043/diff/1/quickstart/settings.py#newcode35
quickstart/settings.py:35: JUJU_DEFAULT_SERIES = ('precise', 'quantal',
'raring', 'saucy', 'trusty')
On 2014/02/19 13:29:09, rharding wrote:
> good call, are these tweaks needed to keep it up to date noted? Maybe
a releases
> section in the hacking doc can note to check the latest charm version
and such?

Done.

https://codereview.appspot.com/65970043/

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'HACKING.rst'
--- HACKING.rst 2014-01-30 12:26:02 +0000
+++ HACKING.rst 2014-02-19 13:55:43 +0000
@@ -134,6 +134,11 @@
134precise to saucy), or in the Juju Quickstart Beta PPA: see134precise to saucy), or in the Juju Quickstart Beta PPA: see
135<https://launchpad.net/~juju-gui/+archive/quickstart-beta/+packages>.135<https://launchpad.net/~juju-gui/+archive/quickstart-beta/+packages>.
136136
137Please also keep up to date the possible values for the environments.yaml
138default-series field (see ``quickstart.settings.JUJU_DEFAULT_SERIES``) and the
139set of series supported by the Juju GUI charm
140(see ``quickstart.settings.JUJU_GUI_SUPPORTED_SERIES``).
141
137Debugging bundle support142Debugging bundle support
138~~~~~~~~~~~~~~~~~~~~~~~~143~~~~~~~~~~~~~~~~~~~~~~~~
139144
140145
=== modified file 'quickstart/__init__.py'
--- quickstart/__init__.py 2014-01-14 09:28:17 +0000
+++ quickstart/__init__.py 2014-02-19 13:55:43 +0000
@@ -1,6 +1,6 @@
1# This file is part of the Juju Quickstart Plugin, which lets users set up a1# This file is part of the Juju Quickstart Plugin, which lets users set up a
2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013-2014 Canonical Ltd.
4#4#
5# This program is free software: you can redistribute it and/or modify it under5# This program is free software: you can redistribute it and/or modify it under
6# the terms of the GNU Affero General Public License version 3, as published by6# the terms of the GNU Affero General Public License version 3, as published by
@@ -22,7 +22,7 @@
22from __future__ import unicode_literals22from __future__ import unicode_literals
2323
2424
25VERSION = (1, 0, 0)25VERSION = (1, 1, 0)
2626
2727
28def get_version():28def get_version():
2929
=== modified file 'quickstart/app.py'
--- quickstart/app.py 2014-01-31 21:00:06 +0000
+++ quickstart/app.py 2014-02-19 13:55:43 +0000
@@ -1,6 +1,6 @@
1# This file is part of the Juju Quickstart Plugin, which lets users set up a1# This file is part of the Juju Quickstart Plugin, which lets users set up a
2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013-2014 Canonical Ltd.
4#4#
5# This program is free software: you can redistribute it and/or modify it under5# This program is free software: you can redistribute it and/or modify it under
6# the terms of the GNU Affero General Public License version 3, as published by6# the terms of the GNU Affero General Public License version 3, as published by
@@ -216,6 +216,27 @@
216 print('a new ssh key was generated in {}'.format(key_file))216 print('a new ssh key was generated in {}'.format(key_file))
217217
218218
219def bootstrap_requires_sudo(is_local):
220 """Return True if "sudo" is required to bootstrap the Juju environment.
221
222 Return False otherwise.
223 Raise a ProgramExit if any error occurs retrieving the Juju version.
224 """
225 if not is_local:
226 return False
227 # If this is a local environment, notify the user that "sudo" will be
228 # required to bootstrap the application, even in newer Juju versions where
229 # "sudo" is invoked by juju-core itself.
230 print('sudo privileges required to bootstrap the environment')
231 # If the Juju core version is less than 1.17.2 then use sudo for local
232 # deployments.
233 try:
234 major, minor, patch = utils.get_juju_version()
235 except ValueError as err:
236 raise ProgramExit(bytes(err))
237 return (major, minor, patch) < (1, 17, 2)
238
239
219def bootstrap(env_name, requires_sudo=False, debug=False):240def bootstrap(env_name, requires_sudo=False, debug=False):
220 """Bootstrap the Juju environment with the given name.241 """Bootstrap the Juju environment with the given name.
221242
@@ -238,7 +259,6 @@
238 already_bootstrapped = False259 already_bootstrapped = False
239 cmd = ['/usr/bin/juju', 'bootstrap', '-e', env_name]260 cmd = ['/usr/bin/juju', 'bootstrap', '-e', env_name]
240 if requires_sudo:261 if requires_sudo:
241 print('sudo privileges required to bootstrap the environment')
242 cmd.insert(0, 'sudo')262 cmd.insert(0, 'sudo')
243 if debug:263 if debug:
244 cmd.append('--debug')264 cmd.append('--debug')
245265
=== modified file 'quickstart/manage.py'
--- quickstart/manage.py 2014-01-31 20:51:16 +0000
+++ quickstart/manage.py 2014-02-19 13:55:43 +0000
@@ -1,6 +1,6 @@
1# This file is part of the Juju Quickstart Plugin, which lets users set up a1# This file is part of the Juju Quickstart Plugin, which lets users set up a
2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013-2014 Canonical Ltd.
4#4#
5# This program is free software: you can redistribute it and/or modify it under5# This program is free software: you can redistribute it and/or modify it under
6# the terms of the GNU Affero General Public License version 3, as published by6# the terms of the GNU Affero General Public License version 3, as published by
@@ -389,16 +389,7 @@
389 print('bootstrapping the {} environment (type: {})'.format(389 print('bootstrapping the {} environment (type: {})'.format(
390 options.env_name, options.env_type))390 options.env_name, options.env_type))
391 is_local = options.env_type == 'local'391 is_local = options.env_type == 'local'
392 requires_sudo = False392 requires_sudo = app.bootstrap_requires_sudo(is_local)
393 if is_local:
394 # If the Juju core version is less than 1.17.2 then
395 # use sudo for local deployments.
396 try:
397 major, minor, patch = utils.get_juju_version()
398 except ValueError as err:
399 raise app.ProgramExit(bytes(err))
400 requires_sudo = utils.local_bootstrap_requires_sudo(
401 major, minor, patch)
402 already_bootstrapped, bsn_series = app.bootstrap(393 already_bootstrapped, bsn_series = app.bootstrap(
403 options.env_name, requires_sudo=requires_sudo, debug=options.debug)394 options.env_name, requires_sudo=requires_sudo, debug=options.debug)
404395
405396
=== modified file 'quickstart/settings.py'
--- quickstart/settings.py 2013-12-10 17:22:44 +0000
+++ quickstart/settings.py 2014-02-19 13:55:43 +0000
@@ -1,6 +1,6 @@
1# This file is part of the Juju Quickstart Plugin, which lets users set up a1# This file is part of the Juju Quickstart Plugin, which lets users set up a
2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013-2014 Canonical Ltd.
4#4#
5# This program is free software: you can redistribute it and/or modify it under5# This program is free software: you can redistribute it and/or modify it under
6# the terms of the GNU Affero General Public License version 3, as published by6# the terms of the GNU Affero General Public License version 3, as published by
@@ -26,13 +26,13 @@
2626
27# The default Juju GUI charm URL to use when it is not possible to retrieve it27# The default Juju GUI charm URL to use when it is not possible to retrieve it
28# from the charmworld API, e.g. due to temporary connection/charmworld errors.28# from the charmworld API, e.g. due to temporary connection/charmworld errors.
29DEFAULT_CHARM_URL = 'cs:precise/juju-gui-80'29DEFAULT_CHARM_URL = 'cs:precise/juju-gui-83'
3030
31# The quickstart app short description.31# The quickstart app short description.
32DESCRIPTION = 'set up a Juju environment (including the GUI) in very few steps'32DESCRIPTION = 'set up a Juju environment (including the GUI) in very few steps'
3333
34# The possible values for the environments.yaml default-series field.34# The possible values for the environments.yaml default-series field.
35JUJU_DEFAULT_SERIES = ('precise', 'quantal', 'raring', 'saucy')35JUJU_DEFAULT_SERIES = ('precise', 'quantal', 'raring', 'saucy', 'trusty')
3636
37# Retrieve the current juju-core home.37# Retrieve the current juju-core home.
38JUJU_HOME = os.getenv('JUJU_HOME', '~/.juju')38JUJU_HOME = os.getenv('JUJU_HOME', '~/.juju')
3939
=== modified file 'quickstart/tests/test_app.py'
--- quickstart/tests/test_app.py 2014-01-31 21:38:59 +0000
+++ quickstart/tests/test_app.py 2014-02-19 13:55:43 +0000
@@ -1,6 +1,6 @@
1# This file is part of the Juju Quickstart Plugin, which lets users set up a1# This file is part of the Juju Quickstart Plugin, which lets users set up a
2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013-2014 Canonical Ltd.
4#4#
5# This program is free software: you can redistribute it and/or modify it under5# This program is free software: you can redistribute it and/or modify it under
6# the terms of the GNU Affero General Public License version 3, as published by6# the terms of the GNU Affero General Public License version 3, as published by
@@ -400,6 +400,56 @@
400400
401401
402@helpers.mock_print402@helpers.mock_print
403class TestBootstrapRequiresSudo(ProgramExitTestsMixin, unittest.TestCase):
404
405 sudo_message = 'sudo privileges required to bootstrap the environment'
406
407 def patch_get_juju_version(self, return_value):
408 """Patch the quickstart.utils.get_juju_version function."""
409 if isinstance(return_value, Exception):
410 mock_get_juju_version = mock.Mock(side_effect=return_value)
411 else:
412 mock_get_juju_version = mock.Mock(return_value=return_value)
413 return mock.patch(
414 'quickstart.utils.get_juju_version', mock_get_juju_version)
415
416 def test_not_local(self, mock_print):
417 # Sudo privileges are never required for non-local environments.
418 self.assertFalse(app.bootstrap_requires_sudo(False))
419
420 def test_sudo_required(self, mock_print):
421 # Sudo privileges are required if the Juju version is < 1.17.2.
422 versions = [(0, 7, 9), (1, 0, 0), (1, 16, 42), (1, 17, 0), (1, 17, 1)]
423 for version in versions:
424 with self.patch_get_juju_version(version):
425 requires_sudo = app.bootstrap_requires_sudo(True)
426 self.assertTrue(requires_sudo, version)
427 # On local environments the "sudo privileges required" message is
428 # always printed.
429 mock_print.assert_called_once_with(self.sudo_message)
430 mock_print.reset_mock()
431
432 def test_sudo_not_required(self, mock_print):
433 # Sudo privileges are not required if the Juju version is >= 1.17.2.
434 versions = [
435 (1, 17, 2), (1, 17, 10), (1, 18, 0), (1, 18, 2), (2, 16, 1)]
436 for version in versions:
437 with self.patch_get_juju_version(version):
438 requires_sudo = app.bootstrap_requires_sudo(True)
439 self.assertFalse(requires_sudo, version)
440 # On local environments the "sudo privileges required" message is
441 # always printed.
442 mock_print.assert_called_once_with(self.sudo_message)
443 mock_print.reset_mock()
444
445 def test_invalid_version(self, mock_print):
446 # A ProgramExit is raised if the Juju version is not valid.
447 with self.patch_get_juju_version(ValueError(b'bad wolf')):
448 with self.assert_program_exit('bad wolf'):
449 app.bootstrap_requires_sudo(True)
450
451
452@helpers.mock_print
403class TestBootstrap(453class TestBootstrap(
404 helpers.CallTestsMixin, ProgramExitTestsMixin, unittest.TestCase):454 helpers.CallTestsMixin, ProgramExitTestsMixin, unittest.TestCase):
405455
@@ -459,10 +509,7 @@
459 mock_call.assert_has_calls([509 mock_call.assert_has_calls([
460 mock.call('sudo', self.juju, 'bootstrap', '-e', self.env_name),510 mock.call('sudo', self.juju, 'bootstrap', '-e', self.env_name),
461 ] + self.make_status_calls(1))511 ] + self.make_status_calls(1))
462 mock_print.assert_has_calls([512 mock_print.assert_called_once_with(self.status_message)
463 mock.call('sudo privileges required to bootstrap the environment'),
464 mock.call(self.status_message),
465 ])
466513
467 def test_success_debug(self, mock_print):514 def test_success_debug(self, mock_print):
468 # The environment is successfully bootstrapped in debug mode.515 # The environment is successfully bootstrapped in debug mode.
469516
=== modified file 'quickstart/tests/test_manage.py'
--- quickstart/tests/test_manage.py 2014-01-31 18:09:48 +0000
+++ quickstart/tests/test_manage.py 2014-02-19 13:55:43 +0000
@@ -1,6 +1,6 @@
1# This file is part of the Juju Quickstart Plugin, which lets users set up a1# This file is part of the Juju Quickstart Plugin, which lets users set up a
2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013-2014 Canonical Ltd.
4#4#
5# This program is free software: you can redistribute it and/or modify it under5# This program is free software: you can redistribute it and/or modify it under
6# the terms of the GNU Affero General Public License version 3, as published by6# the terms of the GNU Affero General Public License version 3, as published by
@@ -669,12 +669,6 @@
669 msg = 'admin-secret not found in {}'.format(path)669 msg = 'admin-secret not found in {}'.format(path)
670 raise ValueError(msg.encode('utf-8'))670 raise ValueError(msg.encode('utf-8'))
671671
672 @staticmethod
673 def patch_get_juju_version(major, minor, patch):
674 """Patch the quickstart.utils.get_juju_version function."""
675 mock_call = mock.Mock(return_value=(major, minor, patch))
676 return mock.patch('quickstart.utils.get_juju_version', mock_call)
677
678 def test_no_bundle(self, mock_app, mock_open):672 def test_no_bundle(self, mock_app, mock_open):
679 # The application runs correctly if no bundle is provided.673 # The application runs correctly if no bundle is provided.
680 token = 'AUTHTOKEN'674 token = 'AUTHTOKEN'
@@ -683,12 +677,12 @@
683 mock_app.bootstrap.return_value = (True, 'precise')677 mock_app.bootstrap.return_value = (True, 'precise')
684 mock_app.get_admin_secret = self.mock_get_admin_secret_error678 mock_app.get_admin_secret = self.mock_get_admin_secret_error
685 options = self.make_options()679 options = self.make_options()
686 with self.patch_get_juju_version(1, 17, 1):680 manage.run(options)
687 manage.run(options)
688 mock_app.ensure_dependencies.assert_called()681 mock_app.ensure_dependencies.assert_called()
689 mock_app.ensure_ssh_keys.assert_called()682 mock_app.ensure_ssh_keys.assert_called()
690 mock_app.bootstrap.assert_called_once_with(683 mock_app.bootstrap.assert_called_once_with(
691 options.env_name, requires_sudo=False, debug=options.debug)684 options.env_name, requires_sudo=mock_app.bootstrap_requires_sudo(),
685 debug=options.debug)
692 mock_app.get_api_url.assert_called_once_with(options.env_name)686 mock_app.get_api_url.assert_called_once_with(options.env_name)
693 mock_app.connect.assert_has_calls([687 mock_app.connect.assert_has_calls([
694 mock.call(mock_app.get_api_url(), options.admin_secret),688 mock.call(mock_app.get_api_url(), options.admin_secret),
@@ -731,9 +725,9 @@
731 # The application correctly handles working with local providers with725 # The application correctly handles working with local providers with
732 # new Juju versions not requiring "sudo" to bootstrap the environment.726 # new Juju versions not requiring "sudo" to bootstrap the environment.
733 options = self.make_options(env_type='local')727 options = self.make_options(env_type='local')
728 mock_app.bootstrap_requires_sudo.return_value = False
734 mock_app.bootstrap.return_value = (True, 'precise')729 mock_app.bootstrap.return_value = (True, 'precise')
735 with self.patch_get_juju_version(1, 18, 0):730 manage.run(options)
736 manage.run(options)
737 mock_app.bootstrap.assert_called_once_with(731 mock_app.bootstrap.assert_called_once_with(
738 options.env_name, requires_sudo=False, debug=options.debug)732 options.env_name, requires_sudo=False, debug=options.debug)
739733
@@ -741,9 +735,9 @@
741 # The application correctly handles working with local providers when735 # The application correctly handles working with local providers when
742 # Juju requires an external "sudo" call to bootstrap the environment.736 # Juju requires an external "sudo" call to bootstrap the environment.
743 options = self.make_options(env_type='local')737 options = self.make_options(env_type='local')
738 mock_app.bootstrap_requires_sudo.return_value = True
744 mock_app.bootstrap.return_value = (True, 'precise')739 mock_app.bootstrap.return_value = (True, 'precise')
745 with self.patch_get_juju_version(1, 17, 1):740 manage.run(options)
746 manage.run(options)
747 mock_app.bootstrap.assert_called_once_with(741 mock_app.bootstrap.assert_called_once_with(
748 options.env_name, requires_sudo=True, debug=options.debug)742 options.env_name, requires_sudo=True, debug=options.debug)
749743
750744
=== modified file 'quickstart/tests/test_utils.py'
--- quickstart/tests/test_utils.py 2014-01-31 18:09:48 +0000
+++ quickstart/tests/test_utils.py 2014-02-19 13:55:43 +0000
@@ -1,6 +1,6 @@
1# This file is part of the Juju Quickstart Plugin, which lets users set up a1# This file is part of the Juju Quickstart Plugin, which lets users set up a
2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013-2014 Canonical Ltd.
4#4#
5# This program is free software: you can redistribute it and/or modify it under5# This program is free software: you can redistribute it and/or modify it under
6# the terms of the GNU Affero General Public License version 3, as published by6# the terms of the GNU Affero General Public License version 3, as published by
@@ -710,26 +710,3 @@
710 utils.get_juju_version()710 utils.get_juju_version()
711 msg = 'invalid version string: 1.17'711 msg = 'invalid version string: 1.17'
712 self.assertEqual(msg, bytes(context_manager.exception))712 self.assertEqual(msg, bytes(context_manager.exception))
713
714
715class TestLocalBootstrapRequiresSudo(unittest.TestCase):
716
717 def test_returns_true_on_lower_than_1_17_2(self):
718 # If Juju version is lower than 1.17.2.
719 value = utils.local_bootstrap_requires_sudo(1, 17, 0)
720 self.assertTrue(value)
721 value = utils.local_bootstrap_requires_sudo(1, 16, 5)
722 self.assertTrue(value)
723
724 def test_returns_false_higher_than_1_17_1(self):
725 # If juju version is higher than 1.17.1.
726 value = utils.local_bootstrap_requires_sudo(1, 17, 2)
727 self.assertFalse(value)
728 value = utils.local_bootstrap_requires_sudo(1, 17, 10)
729 self.assertFalse(value)
730 value = utils.local_bootstrap_requires_sudo(1, 18, 0)
731 self.assertFalse(value)
732 value = utils.local_bootstrap_requires_sudo(1, 18, 2)
733 self.assertFalse(value)
734 value = utils.local_bootstrap_requires_sudo(2, 16, 1)
735 self.assertFalse(value)
736713
=== modified file 'quickstart/utils.py'
--- quickstart/utils.py 2014-01-31 18:09:48 +0000
+++ quickstart/utils.py 2014-02-19 13:55:43 +0000
@@ -1,6 +1,6 @@
1# This file is part of the Juju Quickstart Plugin, which lets users set up a1# This file is part of the Juju Quickstart Plugin, which lets users set up a
2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).2# Juju environment in very few steps (https://launchpad.net/juju-quickstart).
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013-2014 Canonical Ltd.
4#4#
5# This program is free software: you can redistribute it and/or modify it under5# This program is free software: you can redistribute it and/or modify it under
6# the terms of the GNU Affero General Public License version 3, as published by6# the terms of the GNU Affero General Public License version 3, as published by
@@ -348,15 +348,6 @@
348 raise ValueError(msg.encode('utf-8'))348 raise ValueError(msg.encode('utf-8'))
349349
350350
351def local_bootstrap_requires_sudo(major, minor, patch):
352 """Parse Juju version to check if sudo is required for local deployment.
353
354 Before Juju version 1.17.2 sudo is required for bootstrapping
355 local environments.
356 """
357 return (major, minor, patch) < (1, 17, 2)
358
359
360def run_once(function):351def run_once(function):
361 """Return a decorated version of the given function which runs only once.352 """Return a decorated version of the given function which runs only once.
362353

Subscribers

People subscribed via source and target branches