{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/19612","labels_url":"https://api.github.com/repos/saltstack/salt/issues/19612/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/19612/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/19612/events","html_url":"https://github.com/saltstack/salt/issues/19612","id":53966338,"number":19612,"title":"File based grains do not override custom grains","user":{"login":"dnd","id":37888,"avatar_url":"https://avatars.githubusercontent.com/u/37888?v=3","gravatar_id":"","url":"https://api.github.com/users/dnd","html_url":"https://github.com/dnd","followers_url":"https://api.github.com/users/dnd/followers","following_url":"https://api.github.com/users/dnd/following{/other_user}","gists_url":"https://api.github.com/users/dnd/gists{/gist_id}","starred_url":"https://api.github.com/users/dnd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnd/subscriptions","organizations_url":"https://api.github.com/users/dnd/orgs","repos_url":"https://api.github.com/users/dnd/repos","events_url":"https://api.github.com/users/dnd/events{/privacy}","received_events_url":"https://api.github.com/users/dnd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Cannot+Reproduce","name":"Cannot Reproduce","color":"bfd4f2"},{"url":"https://api.github.com/repos/saltstack/salt/labels/High+Severity","name":"High Severity","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","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":1833,"closed_issues":1418,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-01-20T18:32:51Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2015-01-10T18:13:09Z","updated_at":"2015-01-20T20:41:35Z","closed_at":null,"body":"According to my understanding of the grain load order, custom grains are loaded first, then core grains, and finally file based grains. It would conceptually make sense that as each step went along, it would override a grain set with the same name prior. What I'm seeing though is that if a custom grain sets a value, and the file based grains sets the same value, the custom grain will win.\r\n\r\nTo work around this I have added code to my custom grain to read in `/etc/salt/grains`, and check for the existence of the grain. If it's present, then I skip the loading of the grain, and let it get set via the file. This shouldn't be necessary though, because file based grains are much more specific to a minion than a programmed one."},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/70728856","html_url":"https://github.com/saltstack/salt/issues/19612#issuecomment-70728856","issue_url":"https://api.github.com/repos/saltstack/salt/issues/19612","id":70728856,"user":{"login":"whiteinge","id":91293,"avatar_url":"https://avatars.githubusercontent.com/u/91293?v=3","gravatar_id":"","url":"https://api.github.com/users/whiteinge","html_url":"https://github.com/whiteinge","followers_url":"https://api.github.com/users/whiteinge/followers","following_url":"https://api.github.com/users/whiteinge/following{/other_user}","gists_url":"https://api.github.com/users/whiteinge/gists{/gist_id}","starred_url":"https://api.github.com/users/whiteinge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whiteinge/subscriptions","organizations_url":"https://api.github.com/users/whiteinge/orgs","repos_url":"https://api.github.com/users/whiteinge/repos","events_url":"https://api.github.com/users/whiteinge/events{/privacy}","received_events_url":"https://api.github.com/users/whiteinge/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T20:41:35Z","updated_at":"2015-01-20T20:41:35Z","body":"+1 for @basepi 's core -> custom grains module -> static etc grains\r\nassertion. It makes the most sense. It will also give access to the core\r\ngrains in __grains__ when authoring a custom grains module instead of a\r\nuseless empty dictionary.\r\n\r\n@cachedout I was testing on 2014.7. I _think_ @dnd was also. Sorry but I\r\ndid not also try against develop.\r\n\r\nOn Tue Jan 20 2015 at 11:58:44 AM Mike Place <notifications@github.com>\r\nwrote:\r\n\r\n> This is exactly the order that's currently exhibited in develop.\r\n>\r\n> @dnd <https://github.com/dnd> In what version of Salt are you witnessing\r\n> this behaviour?\r\n>\r\n> —\r\n> Reply to this email directly or view it on GitHub\r\n> <https://github.com/saltstack/salt/issues/19612#issuecomment-70721646>.\r\n>"}}