{"action":"opened","issue":{"url":"https://api.github.com/repos/juju/docs/issues/850","repository_url":"https://api.github.com/repos/juju/docs","labels_url":"https://api.github.com/repos/juju/docs/issues/850/labels{/name}","comments_url":"https://api.github.com/repos/juju/docs/issues/850/comments","events_url":"https://api.github.com/repos/juju/docs/issues/850/events","html_url":"https://github.com/juju/docs/issues/850","id":131290775,"number":850,"title":"Juju Charm Developer: Add how to install a payload when base layer doesn't provide an explicit state","user":{"login":"arosales","id":1707853,"avatar_url":"https://avatars.githubusercontent.com/u/1707853?v=3","gravatar_id":"","url":"https://api.github.com/users/arosales","html_url":"https://github.com/arosales","followers_url":"https://api.github.com/users/arosales/followers","following_url":"https://api.github.com/users/arosales/following{/other_user}","gists_url":"https://api.github.com/users/arosales/gists{/gist_id}","starred_url":"https://api.github.com/users/arosales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arosales/subscriptions","organizations_url":"https://api.github.com/users/arosales/orgs","repos_url":"https://api.github.com/users/arosales/repos","events_url":"https://api.github.com/users/arosales/events{/privacy}","received_events_url":"https://api.github.com/users/arosales/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-04T09:35:41Z","updated_at":"2016-02-04T09:35:41Z","closed_at":null,"body":"I got feedback from a new charm author reading through:\r\nhttps://jujucharms.com/docs/devel/developer-layers\r\n\r\nSpecifically that there were no hook import statements for installing the payload. When investigating this further with @chuckbutler  the suggestion was to set a \"payload.ready\" state:\r\n\r\n`@when_not('payload.installed)\r\n\r\n\\#install payload here\r\n\r\nset_state('payload.installed')\r\n`\r\n. . .\r\n\r\n`@when(payload.installed)\r\n\r\n\\#do instructions post knowing the payload is installed`\r\n\r\nThis bug is to add this type of example to the developer guide for folks inheriting the a layer that will need such a use case.\r\n\r\n-thanks,\r\nAntonio"}}