~hazmat/pyjuju/proposed-support

« back to all changes in this revision

Viewing changes to juju/control/__init__.py

  • Committer: kapil.thangavelu at canonical
  • Date: 2012-05-22 22:08:15 UTC
  • mfrom: (484.1.53 trunk)
  • Revision ID: kapil.thangavelu@canonical.com-20120522220815-acyt8m89i9ybe0w1
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
import bootstrap
13
13
import config_get
14
14
import config_set
 
15
import constraints_get
15
16
import constraints_set
16
17
import debug_hooks
17
18
import debug_log
39
40
    bootstrap,
40
41
    config_get,
41
42
    config_set,
 
43
    constraints_get,
42
44
    constraints_set,
43
45
    debug_log,
44
46
    debug_hooks,
157
159
 
158
160
def main(args):
159
161
    """The main end user cli command for juju users."""
160
 
    env_config = EnvironmentsConfig()
161
 
    env_config.load_or_write_sample()
162
162
    parser = setup_parser(
163
163
        subcommands=SUBCOMMANDS,
164
164
        prog="juju",
165
165
        description="juju cloud orchestration admin")
166
 
    parser.set_defaults(environments=env_config, log=log)
167
166
 
168
167
    # Some commands, like juju ssh, do a further parse on options by
169
168
    # delegating to another command (such as the underlying ssh). But
179
178
    else:
180
179
        # Otherwise, do be strict
181
180
        options = parser.parse_args(args)
 
181
 
 
182
    env_config = EnvironmentsConfig()
 
183
    env_config.load_or_write_sample()
 
184
    options.environments = env_config
 
185
    options.log = log
 
186
 
182
187
    setup_logging(options)
183
188
    options.command(options)