{"action":"closed","issue":{"url":"https://api.github.com/repos/juju/charm-tools/issues/187","repository_url":"https://api.github.com/repos/juju/charm-tools","labels_url":"https://api.github.com/repos/juju/charm-tools/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/juju/charm-tools/issues/187/comments","events_url":"https://api.github.com/repos/juju/charm-tools/issues/187/events","html_url":"https://github.com/juju/charm-tools/issues/187","id":149561618,"number":187,"title":"Invalid code generation if charm name contains a hyphen","user":{"login":"AdamIsrael","id":125008,"avatar_url":"https://avatars.githubusercontent.com/u/125008?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamIsrael","html_url":"https://github.com/AdamIsrael","followers_url":"https://api.github.com/users/AdamIsrael/followers","following_url":"https://api.github.com/users/AdamIsrael/following{/other_user}","gists_url":"https://api.github.com/users/AdamIsrael/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamIsrael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamIsrael/subscriptions","organizations_url":"https://api.github.com/users/AdamIsrael/orgs","repos_url":"https://api.github.com/users/AdamIsrael/repos","events_url":"https://api.github.com/users/AdamIsrael/events{/privacy}","received_events_url":"https://api.github.com/users/AdamIsrael/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/juju/charm-tools/labels/charm-create","name":"charm-create","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/juju/charm-tools/milestones/14","html_url":"https://github.com/juju/charm-tools/milestones/2.1.PATCH","labels_url":"https://api.github.com/repos/juju/charm-tools/milestones/14/labels","id":1673994,"number":14,"title":"2.1.PATCH","description":"","creator":{"login":"marcoceppi","id":70613,"avatar_url":"https://avatars.githubusercontent.com/u/70613?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoceppi","html_url":"https://github.com/marcoceppi","followers_url":"https://api.github.com/users/marcoceppi/followers","following_url":"https://api.github.com/users/marcoceppi/following{/other_user}","gists_url":"https://api.github.com/users/marcoceppi/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoceppi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoceppi/subscriptions","organizations_url":"https://api.github.com/users/marcoceppi/orgs","repos_url":"https://api.github.com/users/marcoceppi/repos","events_url":"https://api.github.com/users/marcoceppi/events{/privacy}","received_events_url":"https://api.github.com/users/marcoceppi/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":11,"state":"open","created_at":"2016-03-30T13:06:58Z","updated_at":"2016-04-28T05:03:26Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-04-19T19:41:53Z","updated_at":"2016-04-28T05:03:26Z","closed_at":"2016-04-28T05:03:26Z","body":"If a layer-based charm name contains a hyphen, the code generated via `charm build` will fail upon deploy.\r\n\r\n```python\r\n@when_not('terms-example.installed')\r\ndef install_terms-example():\r\n    # Do your setup here.\r\n    set_state('terms-example.installed')\r\n```\r\n\r\nThe hyphen in the method name should be replaced with an underscore."}}