~bac/charmworld/tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/views/api/proof.py

  • Committer: Tarmac
  • Author(s): Matthew Scott
  • Date: 2014-03-07 16:13:24 UTC
  • mfrom: (487.3.4 charm-urls)
  • Revision ID: tarmac-20140307161324-8quz1tbpjxvq5all
Normalize charm URLs in bundles

This branch normalizes the charm URLs in bundles for the GUI, which is expecting at least a <schema>:<series>/<name> style URL.  Current proof allows bundles with charms specified only by name, so long as they're in the charmstore already.

Caveats:
* Currently only works on ingest
* May require a GUI branch as well to add -HEAD if no version number (a smart move anyway) depending on API support.


QA:
* Run
* Enqueue and ingest at least mysql and mediawiki
* bin/enqueue --prefix=~bac/charms/bundles
* bin/ingest-queued --prefix=~bac/charms/bundles --limit=100
* Get bac's bundle wiki:wiki - the charms should all have a charm: attribute, and the attributes should all be URLs as specified above.

https://codereview.appspot.com/71070051/

R=benji, rharding.

Approved by Benji York, Juju Gui Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
265
265
        'errors': [],
266
266
        'error_messages': [],
267
267
        'debug_info': [],
 
268
        'services_info': {},
268
269
        'warning_messages': [],
269
270
    }
270
271
    deployer_string = request.params.get('deployer_file')
319
320
 
320
321
            _proof_charm_constraints(
321
322
                bundle_info, charm_data, name)
 
323
            response_data['services_info'][name] = {
 
324
                'series': charm.series,
 
325
                'name': charm.name,
 
326
                'store_url': charm.store_url,
 
327
            }
322
328
 
323
329
        # Verify that the relations specified in the bundle are valid for the
324
330
        # interfaces exposed on the charms that were found.