{"action":"created","issue":{"url":"https://api.github.com/repos/volanja/ansible_spec/issues/47","labels_url":"https://api.github.com/repos/volanja/ansible_spec/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/volanja/ansible_spec/issues/47/comments","events_url":"https://api.github.com/repos/volanja/ansible_spec/issues/47/events","html_url":"https://github.com/volanja/ansible_spec/issues/47","id":109804047,"number":47,"title":"NoMethodError: undefined method `each' for nil:NilClass if inventory has \"roles\"=>[]","user":{"login":"phiche","id":5618563,"avatar_url":"https://avatars.githubusercontent.com/u/5618563?v=3","gravatar_id":"","url":"https://api.github.com/users/phiche","html_url":"https://github.com/phiche","followers_url":"https://api.github.com/users/phiche/followers","following_url":"https://api.github.com/users/phiche/following{/other_user}","gists_url":"https://api.github.com/users/phiche/gists{/gist_id}","starred_url":"https://api.github.com/users/phiche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phiche/subscriptions","organizations_url":"https://api.github.com/users/phiche/orgs","repos_url":"https://api.github.com/users/phiche/repos","events_url":"https://api.github.com/users/phiche/events{/privacy}","received_events_url":"https://api.github.com/users/phiche/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-05T14:08:44Z","updated_at":"2015-10-06T14:30:50Z","closed_at":"2015-10-06T14:30:50Z","body":"If for some reason the roles list for a host is empty, ansible_spec dies with ```NoMethodError: undefined method `each' for nil:NilClass```\r\n\r\nHere is an example that produces the error\r\n{\"name\"=>\"No-roles-playbook\", \"hosts\"=>[\"127.0.0.1\"], \"roles\"=>[], \"sudo\"=>true}\r\n\r\n```\r\nrake aborted!\r\nNoMethodError: undefined method `each' for nil:NilClass\r\n/usr/local/rvm/gems/ruby-2.0.0-p643/gems/ansible_spec-0.2.2/lib/ansible_spec/load_ansible.rb:203:in `flatten_role'\r\n/usr/local/rvm/gems/ruby-2.0.0-p643/gems/ansible_spec-0.2.2/lib/ansible_spec/load_ansible.rb:185:in `block in load_playbook'\r\n/usr/local/rvm/gems/ruby-2.0.0-p643/gems/ansible_spec-0.2.2/lib/ansible_spec/load_ansible.rb:184:in `each'\r\n/usr/local/rvm/gems/ruby-2.0.0-p643/gems/ansible_spec-0.2.2/lib/ansible_spec/load_ansible.rb:184:in `load_playbook'\r\n/usr/local/rvm/gems/ruby-2.0.0-p643/gems/ansible_spec-0.2.2/lib/ansible_spec/load_ansible.rb:233:in `get_properties'\r\n```"},"comment":{"url":"https://api.github.com/repos/volanja/ansible_spec/issues/comments/145873980","html_url":"https://github.com/volanja/ansible_spec/issues/47#issuecomment-145873980","issue_url":"https://api.github.com/repos/volanja/ansible_spec/issues/47","id":145873980,"user":{"login":"volanja","id":5407428,"avatar_url":"https://avatars.githubusercontent.com/u/5407428?v=3","gravatar_id":"","url":"https://api.github.com/users/volanja","html_url":"https://github.com/volanja","followers_url":"https://api.github.com/users/volanja/followers","following_url":"https://api.github.com/users/volanja/following{/other_user}","gists_url":"https://api.github.com/users/volanja/gists{/gist_id}","starred_url":"https://api.github.com/users/volanja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volanja/subscriptions","organizations_url":"https://api.github.com/users/volanja/orgs","repos_url":"https://api.github.com/users/volanja/repos","events_url":"https://api.github.com/users/volanja/events{/privacy}","received_events_url":"https://api.github.com/users/volanja/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T14:30:50Z","updated_at":"2015-10-06T14:30:50Z","body":"I released [v0.2.3](https://rubygems.org/gems/ansible_spec/versions/0.2.3)\r\nThank you :)"}}