juju / juju-bundlelib

A Python library for working with Juju bundles.
GNU Lesser General Public License v3.0
1 stars 14 forks source link

Optionally accept (warn) local charms in bundles #57

Open johnsca opened 7 years ago

johnsca commented 7 years ago

For CI, bundles may have one or more charms replaced with local builds of those charms for testing. However, we'd like to still be able to proof the bundle, since that's a standard part of bundletester. To support that, we'd need the charm.is_local() check issue a warning instead of an error.

simonklb commented 7 years ago

On top of this, mixing local charms and placement yields an error when running charm proof on the bundle.

Traceback (most recent call last):
  File "/usr/local/bin/charm-proof", line 9, in <module>
    load_entry_point('charm-tools==2.1.2', 'console_scripts', 'charm-proof')()
  File "/usr/local/lib/python2.7/dist-packages/charmtools/proof.py", line 63, in main
    lint, exit_code = proof(args_.charm_name, args_.bundle, args_.debug)
  File "/usr/local/lib/python2.7/dist-packages/charmtools/proof.py", line 57, in proof
    lint, err_code = c.proof()
  File "/usr/local/lib/python2.7/dist-packages/charmtools/bundles.py", line 92, in proof
    lint.proof(self)
  File "/usr/local/lib/python2.7/dist-packages/charmtools/bundles.py", line 47, in proof
    errors = jujubundlelib.validation.validate(data)
  File "/usr/local/lib/python2.7/dist-packages/jujubundlelib/validation.py", line 52, in validate
    _validate_services(services, machines, add_error)
  File "/usr/local/lib/python2.7/dist-packages/jujubundlelib/validation.py", line 151, in _validate_services
    placement, services, machines, charm, add_error)
  File "/usr/local/lib/python2.7/dist-packages/jujubundlelib/validation.py", line 371, in _validate_placement
    if charm.series and series and charm.series != series:
AttributeError: 'NoneType' object has no attribute 'series'