~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/testing/factory.py

  • Committer: Tarmac
  • Author(s): Brad Crittenden
  • Date: 2013-08-23 22:01:47 UTC
  • mfrom: (358.1.14 official-bundle-json)
  • Revision ID: tarmac-20130823220147-z0pg084iaro0afyh
[r=sinzui][bug=1215473][author=bac] Support official/promulgated bundles.  Change bundle to store basket_name and basket_revision separately rather than as on combined basket_id with name/rev.  Always use 'bundles' in the path for web and api requests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
311
311
    return record_id, charm
312
312
 
313
313
 
314
 
def get_bundle_data(name=None, owner=None, basket=None, series='precise',
 
314
def get_bundle_data(name=None, owner=None, basket_with_rev=None, series='precise',
315
315
                    title='', description='', services=dict(),
316
316
                    relations=dict(), promulgated=False, branch_deleted=False,
317
317
                    ):
319
319
        name = random_string(10)
320
320
    if owner is None:
321
321
        owner = random_string(10)
322
 
    if basket is None:
323
 
        basket = "%s/%d" % (random_string(10), randint(0, 100))
 
322
    if basket_with_rev is None:
 
323
        basket_with_rev = "%s/%d" % (random_string(10), randint(0, 100))
324
324
    data = dict(series=series,
325
325
                relations=relations,
326
326
                services=services)
327
 
    bundle_doc = make_bundle_doc(data, owner, basket, name)
 
327
    bundle_doc = make_bundle_doc(data, owner, basket_with_rev, name)
328
328
    bundle_doc.update(dict(branch_deleted=branch_deleted,
329
329
                           data=data,
330
330
                           description=description,