{"action":"created","issue":{"url":"https://api.github.com/repos/chorankates/rouster/issues/109","repository_url":"https://api.github.com/repos/chorankates/rouster","labels_url":"https://api.github.com/repos/chorankates/rouster/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/chorankates/rouster/issues/109/comments","events_url":"https://api.github.com/repos/chorankates/rouster/issues/109/events","html_url":"https://github.com/chorankates/rouster/pull/109","id":248502130,"number":109,"title":"Support `getent group` output in `get_groups()`","user":{"login":"stevemil00","id":5047599,"avatar_url":"https://avatars2.githubusercontent.com/u/5047599?v=4","gravatar_id":"","url":"https://api.github.com/users/stevemil00","html_url":"https://github.com/stevemil00","followers_url":"https://api.github.com/users/stevemil00/followers","following_url":"https://api.github.com/users/stevemil00/following{/other_user}","gists_url":"https://api.github.com/users/stevemil00/gists{/gist_id}","starred_url":"https://api.github.com/users/stevemil00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevemil00/subscriptions","organizations_url":"https://api.github.com/users/stevemil00/orgs","repos_url":"https://api.github.com/users/stevemil00/repos","events_url":"https://api.github.com/users/stevemil00/events{/privacy}","received_events_url":"https://api.github.com/users/stevemil00/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-07T19:04:12Z","updated_at":"2017-08-08T18:48:45Z","closed_at":"2017-08-08T16:53:26Z","pull_request":{"url":"https://api.github.com/repos/chorankates/rouster/pulls/109","html_url":"https://github.com/chorankates/rouster/pull/109","diff_url":"https://github.com/chorankates/rouster/pull/109.diff","patch_url":"https://github.com/chorankates/rouster/pull/109.patch"},"body":"Normal /etc/group lines, at least on Linux hosts, look like:\r\n\r\n```\r\ngroupname:x:999:possibly-empty-list-o-users\r\n```\r\n\r\nHowever, what you get back using `getent group` can look like:\r\n\r\n```\r\ngroupname::999:possibly-empty-list-o-users\r\n```\r\n\r\nwhich doesn't match the regex (because there are zero words between those two colons), so all those lines are ignored.\r\n\r\nIt seems like this change (tweaking the regex to accept zero or more words between the two colons) should be safe: I can't think of a case where it wouldn't be safe, but it'd be good to get your sanity check on that.\r\n\r\nI also wasn't sure how best to test this.  As things are now, it seems like you'd need to create a Vagrant instance that uses NIS or something in order to cause `getent` to return a line of the form I'm describing.  As an alternative, I suppose you could tweak the implementation of `get_groups()` to take, I dunno, a default-nil parameter with an array of group-style output strings, like:\r\n\r\n```\r\ngroup_test_data = [\r\n   \"unix100:x:100\\nunix200:x:200\\n\",\r\n   \"nis100::100\\nnis200::200\\n\",\r\n]\r\n```\r\n\r\nand treat those as what's come back from the `cat /etc/group` and `getent group` calls, respectively, assuming the parameter isn't nil. \r\n\r\nSo depending on what you think makes sense, I can update this PR to catch this case, just let me know.  My Ruby experience is quite limited so I didn't want to go off the deep end! :)"},"comment":{"url":"https://api.github.com/repos/chorankates/rouster/issues/comments/321047408","html_url":"https://github.com/chorankates/rouster/pull/109#issuecomment-321047408","issue_url":"https://api.github.com/repos/chorankates/rouster/issues/109","id":321047408,"user":{"login":"stevemil00","id":5047599,"avatar_url":"https://avatars2.githubusercontent.com/u/5047599?v=4","gravatar_id":"","url":"https://api.github.com/users/stevemil00","html_url":"https://github.com/stevemil00","followers_url":"https://api.github.com/users/stevemil00/followers","following_url":"https://api.github.com/users/stevemil00/following{/other_user}","gists_url":"https://api.github.com/users/stevemil00/gists{/gist_id}","starred_url":"https://api.github.com/users/stevemil00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevemil00/subscriptions","organizations_url":"https://api.github.com/users/stevemil00/orgs","repos_url":"https://api.github.com/users/stevemil00/repos","events_url":"https://api.github.com/users/stevemil00/events{/privacy}","received_events_url":"https://api.github.com/users/stevemil00/received_events","type":"User","site_admin":false},"created_at":"2017-08-08T18:48:45Z","updated_at":"2017-08-08T18:48:45Z","body":"Thanks!"}}
{"actor":{"display_login":"stevemil00"}}