{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/220676781","pull_request_review_id":159139586,"id":220676781,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDY3Njc4MQ==","diff_hunk":"@@ -96,7 +106,13 @@ def construct_command(self):\n     def get_system_boot_time(self):\n         stdout = b''\n         stderr = b''\n-        command_result = self._low_level_execute_command(self.DEFAULT_BOOT_TIME_COMMAND, sudoable=self.DEFAULT_SUDOABLE)\n+\n+        # Determine the system distribution in order to use the correct shutdown command arguments\n+        uname_result = self._low_level_execute_command('uname')\n+        distribution = uname_result['stdout'].strip().lower()\n+\n+        boot_time_command = self.BOOT_TIME_COMMANDS.get(distribution, self.BOOT_TIME_COMMANDS['linux'])","path":"lib/ansible/plugins/action/reboot.py","position":40,"original_position":40,"commit_id":"dbf18e11f291f44a09c0568de6bf9902b39b55ad","original_commit_id":"dbf18e11f291f44a09c0568de6bf9902b39b55ad","user":{"login":"samdoran","id":4047861,"node_id":"MDQ6VXNlcjQwNDc4NjE=","avatar_url":"https://avatars2.githubusercontent.com/u/4047861?v=4","gravatar_id":"","url":"https://api.github.com/users/samdoran","html_url":"https://github.com/samdoran","followers_url":"https://api.github.com/users/samdoran/followers","following_url":"https://api.github.com/users/samdoran/following{/other_user}","gists_url":"https://api.github.com/users/samdoran/gists{/gist_id}","starred_url":"https://api.github.com/users/samdoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdoran/subscriptions","organizations_url":"https://api.github.com/users/samdoran/orgs","repos_url":"https://api.github.com/users/samdoran/repos","events_url":"https://api.github.com/users/samdoran/events{/privacy}","received_events_url":"https://api.github.com/users/samdoran/received_events","type":"User","site_admin":false},"body":"Change the default to `self.DEFAULT_BOOT_TIME_COMMAND` instead of `self.BOOT_TIME_COMMANDS['linux']`.","created_at":"2018-09-26T18:35:28Z","updated_at":"2018-09-26T18:41:45Z","html_url":"https://github.com/ansible/ansible/pull/46147#discussion_r220676781","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/46147","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/220676781"},"html":{"href":"https://github.com/ansible/ansible/pull/46147#discussion_r220676781"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/46147"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/46147","id":218171355,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4MTcxMzU1","html_url":"https://github.com/ansible/ansible/pull/46147","diff_url":"https://github.com/ansible/ansible/pull/46147.diff","patch_url":"https://github.com/ansible/ansible/pull/46147.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/46147","number":46147,"state":"open","locked":false,"title":"Add support for OpenBSD to the (new) reboot module","user":{"login":"danieljakots","id":11314261,"node_id":"MDQ6VXNlcjExMzE0MjYx","avatar_url":"https://avatars1.githubusercontent.com/u/11314261?v=4","gravatar_id":"","url":"https://api.github.com/users/danieljakots","html_url":"https://github.com/danieljakots","followers_url":"https://api.github.com/users/danieljakots/followers","following_url":"https://api.github.com/users/danieljakots/following{/other_user}","gists_url":"https://api.github.com/users/danieljakots/gists{/gist_id}","starred_url":"https://api.github.com/users/danieljakots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieljakots/subscriptions","organizations_url":"https://api.github.com/users/danieljakots/orgs","repos_url":"https://api.github.com/users/danieljakots/repos","events_url":"https://api.github.com/users/danieljakots/events{/privacy}","received_events_url":"https://api.github.com/users/danieljakots/received_events","type":"User","site_admin":false},"body":"##### SUMMARY\r\n<!--- Describe the change below, including rationale and design decisions -->\r\nI heard about the upcoming reboot module but it doesn't work on OpenBSD because of the commands it uses. This PR fixes this!\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest -->\r\n- Bugfix Pull Request\r\n\r\nlack of support is a bug, right? ;)\r\n\r\n##### COMPONENT NAME\r\n<!--- Write the short name of the module, plugin, task or feature below -->\r\nreboot\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes -->\r\n```paste below\r\nansible 2.8.0.dev0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = [u'/home/danj/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /usr/local/venv/ansible/lib/python2.7/site-packages/ansible\r\n  executable location = /usr/local/venv/ansible/bin/ansible\r\n  python version = 2.7.15 (default, Aug 27 2018, 10:53:50) [GCC 4.2.1 Compatible OpenBSD Clang 6.0.0 (tags/RELEASE_600/final)]\r\n\r\n```\r\n\r\n##### ADDITIONAL INFORMATION\r\n<!--- Include additional information to help people understand the change here -->\r\n<!--- A step-by-step reproduction of the problem is helpful if there is no related issue -->\r\n\r\n<!--- Paste verbatim command output below, e.g. before and after your change -->\r\nbefore:\r\n```paste below\r\nodessa-root | FAILED! => {\r\n    \"changed\": false, \r\n    \"msg\": \"reboot: failed to get host boot time info, rc: 1, stdout: who: unknown option -- b\\r\\nusage: who [-HmqTu] [file]\\r\\n       who am i\\r\\ncat: /proc/sys/kernel/random/boot_id: No such file or directory\\r\\n, stderr: Shared connection to 10.20.20.10 closed.\\r\\nShared connection to 10.20.20.10 closed.\\r\\n\", \r\n    \"reboot\": false\r\n}\r\n```\r\nafter:\r\n```\r\nodessa-root | CHANGED => {\r\n    \"changed\": true, \r\n    \"elapsed\": 57, \r\n    \"rebooted\": true\r\n}\r\n```\r\n\r\nI picked /sbin/sysctl kern.boottime because it seems to match the 'who -b' from Linux:\r\n$ /sbin/sysctl kern.boottime\r\nkern.boottime=Tue Sep 25 20:42:43 2018\r\n\r\nOn OpenBSD, shutdown -r time takes time in minutes, see the man for confirmation: https://man.openbsd.org/shutdown#r\r\n\r\nIs there anything else you need? Can it goes into 2.7 please? :3\r\n\r\nThanks!","created_at":"2018-09-26T02:28:42Z","updated_at":"2018-09-26T18:41:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc6c96c85e922ee940fdfb58754d76e0fb75ea17","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1043397454,"node_id":"MDU6TGFiZWwxMDQzMzk3NDU0","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.8","name":"affects_2.8","color":"ededed","default":false},{"id":785271699,"node_id":"MDU6TGFiZWw3ODUyNzE2OTk=","url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":496359346,"node_id":"MDU6TGFiZWw0OTYzNTkzNDY=","url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":499433583,"node_id":"MDU6TGFiZWw0OTk0MzM1ODM=","url":"https://api.github.com/repos/ansible/ansible/labels/shipit","name":"shipit","color":"fbca04","default":false},{"id":636327968,"node_id":"MDU6TGFiZWw2MzYzMjc5Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false},{"id":636352796,"node_id":"MDU6TGFiZWw2MzYzNTI3OTY=","url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/46147/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/46147/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/46147/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/dbf18e11f291f44a09c0568de6bf9902b39b55ad","head":{"label":"danieljakots:devel","ref":"devel","sha":"dbf18e11f291f44a09c0568de6bf9902b39b55ad","user":{"login":"danieljakots","id":11314261,"node_id":"MDQ6VXNlcjExMzE0MjYx","avatar_url":"https://avatars1.githubusercontent.com/u/11314261?v=4","gravatar_id":"","url":"https://api.github.com/users/danieljakots","html_url":"https://github.com/danieljakots","followers_url":"https://api.github.com/users/danieljakots/followers","following_url":"https://api.github.com/users/danieljakots/following{/other_user}","gists_url":"https://api.github.com/users/danieljakots/gists{/gist_id}","starred_url":"https://api.github.com/users/danieljakots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieljakots/subscriptions","organizations_url":"https://api.github.com/users/danieljakots/orgs","repos_url":"https://api.github.com/users/danieljakots/repos","events_url":"https://api.github.com/users/danieljakots/events{/privacy}","received_events_url":"https://api.github.com/users/danieljakots/received_events","type":"User","site_admin":false},"repo":{"id":150350576,"node_id":"MDEwOlJlcG9zaXRvcnkxNTAzNTA1NzY=","name":"ansible","full_name":"danieljakots/ansible","private":false,"owner":{"login":"danieljakots","id":11314261,"node_id":"MDQ6VXNlcjExMzE0MjYx","avatar_url":"https://avatars1.githubusercontent.com/u/11314261?v=4","gravatar_id":"","url":"https://api.github.com/users/danieljakots","html_url":"https://github.com/danieljakots","followers_url":"https://api.github.com/users/danieljakots/followers","following_url":"https://api.github.com/users/danieljakots/following{/other_user}","gists_url":"https://api.github.com/users/danieljakots/gists{/gist_id}","starred_url":"https://api.github.com/users/danieljakots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danieljakots/subscriptions","organizations_url":"https://api.github.com/users/danieljakots/orgs","repos_url":"https://api.github.com/users/danieljakots/repos","events_url":"https://api.github.com/users/danieljakots/events{/privacy}","received_events_url":"https://api.github.com/users/danieljakots/received_events","type":"User","site_admin":false},"html_url":"https://github.com/danieljakots/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications — automate in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com/ansible/","fork":true,"url":"https://api.github.com/repos/danieljakots/ansible","forks_url":"https://api.github.com/repos/danieljakots/ansible/forks","keys_url":"https://api.github.com/repos/danieljakots/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danieljakots/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danieljakots/ansible/teams","hooks_url":"https://api.github.com/repos/danieljakots/ansible/hooks","issue_events_url":"https://api.github.com/repos/danieljakots/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/danieljakots/ansible/events","assignees_url":"https://api.github.com/repos/danieljakots/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/danieljakots/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/danieljakots/ansible/tags","blobs_url":"https://api.github.com/repos/danieljakots/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danieljakots/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danieljakots/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/danieljakots/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danieljakots/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/danieljakots/ansible/languages","stargazers_url":"https://api.github.com/repos/danieljakots/ansible/stargazers","contributors_url":"https://api.github.com/repos/danieljakots/ansible/contributors","subscribers_url":"https://api.github.com/repos/danieljakots/ansible/subscribers","subscription_url":"https://api.github.com/repos/danieljakots/ansible/subscription","commits_url":"https://api.github.com/repos/danieljakots/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/danieljakots/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/danieljakots/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/danieljakots/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/danieljakots/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/danieljakots/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danieljakots/ansible/merges","archive_url":"https://api.github.com/repos/danieljakots/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danieljakots/ansible/downloads","issues_url":"https://api.github.com/repos/danieljakots/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/danieljakots/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/danieljakots/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/danieljakots/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danieljakots/ansible/labels{/name}","releases_url":"https://api.github.com/repos/danieljakots/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/danieljakots/ansible/deployments","created_at":"2018-09-26T01:23:11Z","updated_at":"2018-09-26T02:18:18Z","pushed_at":"2018-09-26T02:18:13Z","git_url":"git://github.com/danieljakots/ansible.git","ssh_url":"git@github.com:danieljakots/ansible.git","clone_url":"https://github.com/danieljakots/ansible.git","svn_url":"https://github.com/danieljakots/ansible","homepage":"https://www.ansible.com/","size":134246,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"05e3b5d632a52718158d94b26f360426b5de08f0","user":{"login":"ansible","id":1507452,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDc0NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1507452?v=4","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"node_id":"MDEwOlJlcG9zaXRvcnkzNjM4OTY0","name":"ansible","full_name":"ansible/ansible","private":false,"owner":{"login":"ansible","id":1507452,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDc0NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1507452?v=4","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications — automate in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com/ansible/","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2018-09-26T16:17:27Z","pushed_at":"2018-09-26T18:03:19Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"https://www.ansible.com/","size":142033,"stargazers_count":32742,"watchers_count":32742,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12908,"mirror_url":null,"archived":false,"open_issues_count":5376,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":12908,"open_issues":5376,"watchers":32742,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/46147"},"html":{"href":"https://github.com/ansible/ansible/pull/46147"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/46147"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/46147/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/46147/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/46147/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/dbf18e11f291f44a09c0568de6bf9902b39b55ad"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"samdoran"}}