{"action":"created","issue":{"url":"https://api.github.com/repos/mpscholten/maphosts/issues/1","labels_url":"https://api.github.com/repos/mpscholten/maphosts/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/mpscholten/maphosts/issues/1/comments","events_url":"https://api.github.com/repos/mpscholten/maphosts/issues/1/events","html_url":"https://github.com/mpscholten/maphosts/issues/1","id":53645824,"number":1,"title":"Says to run as root when I am root","user":{"login":"greyhound-forty","id":4155466,"avatar_url":"https://avatars.githubusercontent.com/u/4155466?v=3","gravatar_id":"","url":"https://api.github.com/users/greyhound-forty","html_url":"https://github.com/greyhound-forty","followers_url":"https://api.github.com/users/greyhound-forty/followers","following_url":"https://api.github.com/users/greyhound-forty/following{/other_user}","gists_url":"https://api.github.com/users/greyhound-forty/gists{/gist_id}","starred_url":"https://api.github.com/users/greyhound-forty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greyhound-forty/subscriptions","organizations_url":"https://api.github.com/users/greyhound-forty/orgs","repos_url":"https://api.github.com/users/greyhound-forty/repos","events_url":"https://api.github.com/users/greyhound-forty/events{/privacy}","received_events_url":"https://api.github.com/users/greyhound-forty/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-07T15:47:09Z","updated_at":"2015-01-07T17:46:50Z","closed_at":null,"body":"When I run the maphosts command it complains that it is unable to write to /etc/hosts and to try again as root. Odd thing is that it does write to /etc/hosts and I am root.\r\n\r\nOS=Ubuntu 14.04\r\nruby --version = ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]\r\n\r\n```\r\n➜ root@bebop  ~  maphosts toybox.example.com --to 10.0.0.2\r\nUpdating /etc/hosts\r\nUnable to write to /etc/hosts. Trying again as root.\r\n\r\n➜ root@bebop  ~  cat /etc/hosts\r\n127.0.0.1       localhost\r\n184.173.216.182 bebop.tech-casts.com    bebop\r\n\r\n# The following lines are desirable for IPv6 capable hosts\r\n::1     localhost ip6-localhost ip6-loopback\r\nff02::1 ip6-allnodes\r\nff02::2 ip6-allrouters\r\n# -----BEGIN SECTION maphosts - /root-----\r\n10.0.0.2 toybox.example.com\r\n# -----END SECTION maphosts - /root-----\r\n\r\n➜ root@bebop  ~  whoami                                                                         \r\nroot\r\n```"},"comment":{"url":"https://api.github.com/repos/mpscholten/maphosts/issues/comments/69060610","html_url":"https://github.com/mpscholten/maphosts/issues/1#issuecomment-69060610","issue_url":"https://api.github.com/repos/mpscholten/maphosts/issues/1","id":69060610,"user":{"login":"mpscholten","id":2072185,"avatar_url":"https://avatars.githubusercontent.com/u/2072185?v=3","gravatar_id":"","url":"https://api.github.com/users/mpscholten","html_url":"https://github.com/mpscholten","followers_url":"https://api.github.com/users/mpscholten/followers","following_url":"https://api.github.com/users/mpscholten/following{/other_user}","gists_url":"https://api.github.com/users/mpscholten/gists{/gist_id}","starred_url":"https://api.github.com/users/mpscholten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpscholten/subscriptions","organizations_url":"https://api.github.com/users/mpscholten/orgs","repos_url":"https://api.github.com/users/mpscholten/repos","events_url":"https://api.github.com/users/mpscholten/events{/privacy}","received_events_url":"https://api.github.com/users/mpscholten/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T17:46:50Z","updated_at":"2015-01-07T17:46:50Z","body":"The bug should be fixed with the latest release (see 711ceb441607bd0370d55b33ede5663c9b27d345). You can [get it on rubygems](https://rubygems.org/gems/maphosts) or via `gem update`. I also added some more tests to make sure this won't happen again.\r\n\r\nCan you confirm that the fix works?"}}