~mike-mcclurg/pyjuju/xcp-provider

« back to all changes in this revision

Viewing changes to juju/control/deploy.py

  • Committer: William Reade
  • Date: 2011-10-05 10:09:10 UTC
  • mfrom: (348.7.17 check-latest-formulas)
  • Revision ID: fwereade@gmail.com-20111005100910-yfyj6hlodzycyazi
remote formulas are now cached, and verified by SHA256 hash [r=niemeyer][f=861539]

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
           service_name, log, config_file=None):
82
82
    """Deploy a charm within an environment.
83
83
 
84
 
 
85
84
    This will publish the charm to the environment, creating
86
85
    a service from the charm, and get it set to be launched
87
86
    on a new machine.
88
87
    """
89
 
    charm_url, charm = yield resolve(
 
88
    repo, charm_url = resolve(
90
89
        charm_name, repository_path, environment.default_series)
91
90
 
92
91
    # Validate config options prior to deployment attempt
95
94
    if config_file:
96
95
        service_options = parse_config_options(config_file, service_name)
97
96
 
 
97
    charm = yield repo.find(charm_url)
 
98
    charm_id = str(charm_url.with_revision(charm.metadata.revision))
 
99
 
98
100
    provider = environment.get_machine_provider()
99
101
    placement_policy = provider.get_placement_policy()
100
102
    client = yield provider.connect()
108
110
 
109
111
        # Publish the charm to juju
110
112
        publisher = CharmPublisher(client, storage)
111
 
        charm_id = str(charm_url.with_revision(charm.metadata.revision))
112
113
        yield publisher.add_charm(charm_id, charm)
113
114
        result = yield publisher.publish()
114
115