{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/26755","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/26755/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/26755/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/26755/events","html_url":"https://github.com/saltstack/salt/issues/26755","id":103784791,"number":26755,"title":"Associate package dependencies to modules/states?","user":{"login":"lorengordon","id":8457307,"avatar_url":"https://avatars.githubusercontent.com/u/8457307?v=3","gravatar_id":"","url":"https://api.github.com/users/lorengordon","html_url":"https://github.com/lorengordon","followers_url":"https://api.github.com/users/lorengordon/followers","following_url":"https://api.github.com/users/lorengordon/following{/other_user}","gists_url":"https://api.github.com/users/lorengordon/gists{/gist_id}","starred_url":"https://api.github.com/users/lorengordon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorengordon/subscriptions","organizations_url":"https://api.github.com/users/lorengordon/orgs","repos_url":"https://api.github.com/users/lorengordon/repos","events_url":"https://api.github.com/users/lorengordon/events{/privacy}","received_events_url":"https://api.github.com/users/lorengordon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Core","name":"Core","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Feature","name":"Feature","color":"009800"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Loader","name":"Loader","color":"006b75"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P3","name":"P3","color":"0a3d77"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":3064,"closed_issues":3608,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2016-05-12T14:53:50Z","due_on":null,"closed_at":null},"comments":19,"created_at":"2015-08-28T19:52:50Z","updated_at":"2016-05-12T15:39:13Z","closed_at":null,"body":"Right now, typically, the `__virtual__()` function implements a test to see whether the module/state can be loaded, but if the user happens to attempt to call the module/state they just get a somewhat unhelpful message saying it isn't available.\r\n\r\nI think it would be nice if there were a way to associate a required package dependency map (os:package) to a module/state. That way, if the package isn't installed, salt could output a more helpful error message, and salt wouldn't have to create hard dependencies on packages that only a few users may need.\r\n\r\n(Issue prompted by #26703)"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/218796715","html_url":"https://github.com/saltstack/salt/issues/26755#issuecomment-218796715","issue_url":"https://api.github.com/repos/saltstack/salt/issues/26755","id":218796715,"user":{"login":"jacksontj","id":1619869,"avatar_url":"https://avatars.githubusercontent.com/u/1619869?v=3","gravatar_id":"","url":"https://api.github.com/users/jacksontj","html_url":"https://github.com/jacksontj","followers_url":"https://api.github.com/users/jacksontj/followers","following_url":"https://api.github.com/users/jacksontj/following{/other_user}","gists_url":"https://api.github.com/users/jacksontj/gists{/gist_id}","starred_url":"https://api.github.com/users/jacksontj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacksontj/subscriptions","organizations_url":"https://api.github.com/users/jacksontj/orgs","repos_url":"https://api.github.com/users/jacksontj/repos","events_url":"https://api.github.com/users/jacksontj/events{/privacy}","received_events_url":"https://api.github.com/users/jacksontj/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T15:39:12Z","updated_at":"2016-05-12T15:39:12Z","body":"@lorengordon Moving the logging from debug is a bit complicated, as there are quite a few scenarios where you actually load *all* modules even though you don't need most of them (primarily weirdly named modules, or ones that don't exist)-- because of that we set the logging at debug to avoid the log spam. That being said the error message should be better than that jinja error you pasted. Is that a stack trace? If so, would you mind pasting the trace? There is a method on the LazyLoader which gives you the exact error-- so assuming this is a stack trace-- it sounds like the jinja stuff isn't calling the appropriate method to get it, which should be an easy fix ;)"}}