~hatch/juju-quickstart/no-more-sudo

« back to all changes in this revision

Viewing changes to quickstart/manage.py

  • Committer: Jeff Pihach
  • Date: 2014-01-30 20:29:48 UTC
  • Revision ID: jeff.pihach@canonical.com-20140130202948-a30qx06nb8r12rnt
Refactored the local_requires_sudo check outside of the bootstrap method

Show diffs side-by-side

added added

removed removed

Lines of Context:
386
386
    print('bootstrapping the {} environment (type: {})'.format(
387
387
        options.env_name, options.env_type))
388
388
    is_local = options.env_type == 'local'
 
389
    requires_sudo = False
 
390
    if is_local:
 
391
        # If the Juju core version is less than 1.17.2 then
 
392
        # use sudo for local deployments.
 
393
        major, minor, patch = utils.get_juju_version()
 
394
        requires_sudo = utils.local_bootstrap_requires_sudo(
 
395
            major, minor, patch)
389
396
    already_bootstrapped, bsn_series = app.bootstrap(
390
 
        options.env_name, is_local=is_local, debug=options.debug)
391
 
 
 
397
        options.env_name, requires_sudo=requires_sudo, debug=options.debug)
392
398
    print('retrieving the Juju API address')
393
399
    api_url = app.get_api_url(options.env_name)
394
400
    print('connecting to {}'.format(api_url))