Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charm tools needs better parse errors #200

Open
3 tasks done
mbruzek opened this issue Apr 29, 2016 · 4 comments
Open
3 tasks done

Charm tools needs better parse errors #200

mbruzek opened this issue Apr 29, 2016 · 4 comments

Comments

@mbruzek
Copy link
Contributor

mbruzek commented Apr 29, 2016

Checklist

  • Confirmed this is an issue with charm-tools, not charmstore-client
  • Provide versions of tools used
  • Described the feature or ways to replicate the issue

What version am I running?

I ran the following command: charm version and got the following output:

charm 2.1.1-0ubuntu1
charm-tools 2.1.2

I am using: Ubuntu 16.04 Xenial

Issue

After issuing a charm build command I got a python stack trace that told me nothing about the problem or how to fix it.

I expect/expected the following

The actual problem ended up being in layer.yaml with some invalid yaml: includes: ['layer:docker', 'layer:flannel', layer:storage, 'layer:tls', 'interface:etcd'] As you can see I was missing the quotes around layer:storage.

I expected to get a yaml parsing error with the file and line number that was incorrect.

What I got

$ charm build -l DEBUG --series trusty
...(standard debug output omitted)...
Traceback (most recent call last):
  File "/usr/bin/charm-build", line 9, in <module>
    load_entry_point('charm-tools==2.1.2', 'console_scripts', 'charm-build')()
  File "/usr/lib/python2.7/dist-packages/charmtools/build/__init__.py", line 673, in main
    build()
  File "/usr/lib/python2.7/dist-packages/charmtools/build/__init__.py", line 515, in __call__
    self.validate()
  File "/usr/lib/python2.7/dist-packages/charmtools/build/__init__.py", line 471, in validate
    self._validate_charm_repo()
  File "/usr/lib/python2.7/dist-packages/charmtools/build/__init__.py", line 500, in _validate_charm_repo
    if 'repo' not in self.top_layer.config:
  File "/usr/lib/python2.7/dist-packages/charmtools/build/__init__.py", line 139, in top_layer
    self._top_layer = Layer(self.charm, self.deps).fetch()
  File "/usr/lib/python2.7/dist-packages/charmtools/build/__init__.py", line 102, in fetch
    self._name = self.config.name
  File "/usr/lib/python2.7/dist-packages/charmtools/build/__init__.py", line 46, in config
    self._config.configure(self.config_file)
  File "/usr/lib/python2.7/dist-packages/charmtools/build/config.py", line 59, in configure
    except yaml.parser.ParserError:
AttributeError: 'module' object has no attribute 'parser'
@marcoceppi
Copy link
Contributor

This was already fixed, by you, in #178 ?

@marcoceppi
Copy link
Contributor

Guess this is slightly different.

@mbruzek
Copy link
Contributor Author

mbruzek commented Apr 29, 2016

What version did this fix land in?

@marcoceppi
Copy link
Contributor

it hasn't, it's targeted at 1.2.PATCH still which is about to be released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants