{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/36619","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/36619/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/36619/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/36619/events","html_url":"https://github.com/saltstack/salt/issues/36619","id":179621303,"number":36619,"title":"grains.fqdn value is difficult to rely on","user":{"login":"lottspot","id":2199417,"avatar_url":"https://avatars.githubusercontent.com/u/2199417?v=3","gravatar_id":"","url":"https://api.github.com/users/lottspot","html_url":"https://github.com/lottspot","followers_url":"https://api.github.com/users/lottspot/followers","following_url":"https://api.github.com/users/lottspot/following{/other_user}","gists_url":"https://api.github.com/users/lottspot/gists{/gist_id}","starred_url":"https://api.github.com/users/lottspot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lottspot/subscriptions","organizations_url":"https://api.github.com/users/lottspot/orgs","repos_url":"https://api.github.com/users/lottspot/repos","events_url":"https://api.github.com/users/lottspot/events{/privacy}","received_events_url":"https://api.github.com/users/lottspot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-09-27T21:38:34Z","updated_at":"2016-09-29T16:08:01Z","closed_at":null,"body":"It seems that there may be some edge cases where `grains.fqdn` does not produce the same value as, say, `hostname -f`.  This makes the fqdn grain difficult to predict the value of or rely on.\r\n\r\nAfter investigating the issue further, this appears due to [the internal use of `socket.fqdn`](https://github.com/saltstack/salt/blob/develop/salt/utils/network.py#L169) to determine the fqdn grain. It seems that [this issue has been raised before](https://github.com/saltstack/salt/issues/11275) and [was fixed](https://github.com/saltstack/salt/pull/11396/files), but the fix [was later undone](https://github.com/saltstack/salt/commit/d4b7951da8090ed1d40b6a53b72e54a39817f58a). \r\n\r\nThough the current implementation of `get_fqhostname` does try to use `socket.getaddrinfo`, there appears to be no code path through which the canonname value returned by getaddrinfo can then be returned to the caller of get_fqhostname.\r\n\r\nI'm not sure whether the intent is to only use `socket.getfqdn` or to fall back on it only when `socket.getaddrinfo` fails, but it seems like something is off in either case. From the standpoint of an administrator, it would be more intuitive if `get_fqhostname` gave preference to the fqdn as returned in the canonname value from `socket.getaddrinfo`."},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/250512285","html_url":"https://github.com/saltstack/salt/issues/36619#issuecomment-250512285","issue_url":"https://api.github.com/repos/saltstack/salt/issues/36619","id":250512285,"user":{"login":"Ch3LL","id":6886822,"avatar_url":"https://avatars.githubusercontent.com/u/6886822?v=3","gravatar_id":"","url":"https://api.github.com/users/Ch3LL","html_url":"https://github.com/Ch3LL","followers_url":"https://api.github.com/users/Ch3LL/followers","following_url":"https://api.github.com/users/Ch3LL/following{/other_user}","gists_url":"https://api.github.com/users/Ch3LL/gists{/gist_id}","starred_url":"https://api.github.com/users/Ch3LL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ch3LL/subscriptions","organizations_url":"https://api.github.com/users/Ch3LL/orgs","repos_url":"https://api.github.com/users/Ch3LL/repos","events_url":"https://api.github.com/users/Ch3LL/events{/privacy}","received_events_url":"https://api.github.com/users/Ch3LL/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T16:08:01Z","updated_at":"2016-09-29T16:08:01Z","body":"ping @cachedout can I get your input on this issue? Not sure which route is to ensure these edge cases are also taken care of. Thanks!"}}
{"actor":{"display_login":"Ch3LL"}}