)]}'
{"lib/puppet/provider/keystone_user/openstack.rb":[{"author":{"_account_id":6525,"name":"Gilles Dubreuil","email":"gilles@redhat.com","username":"q-1illes-a"},"change_message_id":"54f6c7d097bc61d06ece1e1a6e0dd354665da9de","unresolved":false,"context_lines":[{"line_number":96,"context_line":"      credentials.username     \u003d resource[:name]"},{"line_number":97,"context_line":"      begin"},{"line_number":98,"context_line":"        token \u003d Puppet::Provider::Openstack.request(\u0027token\u0027, \u0027issue\u0027, [\u0027--format\u0027, \u0027value\u0027], credentials)"},{"line_number":99,"context_line":"        if !token.empty?"},{"line_number":100,"context_line":"          res \u003d resource[:password]"},{"line_number":101,"context_line":"        end"},{"line_number":102,"context_line":"      rescue Puppet::Error::OpenstackUnauthorizedError"}],"source_content_type":"text/x-ruby","patch_set":1,"id":"fa32b979_0126e414","line":99,"updated":"2015-06-17 00:17:55.000000000","message":"Common Ruby practices suggest to use:\nunless \u003cCOND\u003e\ninstead of:\nif !\u003cCOND\u003e","commit_id":"b4dfdeb7ba04c248ff845ee4c392ca6ae38439fd"},{"author":{"_account_id":6525,"name":"Gilles Dubreuil","email":"gilles@redhat.com","username":"q-1illes-a"},"change_message_id":"54f6c7d097bc61d06ece1e1a6e0dd354665da9de","unresolved":false,"context_lines":[{"line_number":97,"context_line":"      begin"},{"line_number":98,"context_line":"        token \u003d Puppet::Provider::Openstack.request(\u0027token\u0027, \u0027issue\u0027, [\u0027--format\u0027, \u0027value\u0027], credentials)"},{"line_number":99,"context_line":"        if !token.empty?"},{"line_number":100,"context_line":"          res \u003d resource[:password]"},{"line_number":101,"context_line":"        end"},{"line_number":102,"context_line":"      rescue Puppet::Error::OpenstackUnauthorizedError"},{"line_number":103,"context_line":"        # password is invalid"}],"source_content_type":"text/x-ruby","patch_set":1,"id":"fa32b979_a175b8fa","line":100,"updated":"2015-06-17 00:17:55.000000000","message":"Anything after the request won\u0027t be executed if it fails, which is what we want but maybe it makes it cleared if handled separately in a else statement?\n\nCommon Ruby practices suggest to use:\n\u003cSTATEMENT\u003e if \u003cCOND\u003e\nwhen there is only one statement","commit_id":"b4dfdeb7ba04c248ff845ee4c392ca6ae38439fd"},{"author":{"_account_id":9983,"name":"Richard Megginson","email":"rmeggins@redhat.com","username":"rmeggins"},"change_message_id":"1542c4a616cc1e7d2e09d8cb8eeb5aa3de26332f","unresolved":false,"context_lines":[{"line_number":99,"context_line":"      rescue Puppet::Error::OpenstackUnauthorizedError"},{"line_number":100,"context_line":"        # password is invalid"},{"line_number":101,"context_line":"      else"},{"line_number":102,"context_line":"        res \u003d resource[:password] unless token.empty?"},{"line_number":103,"context_line":"      end"},{"line_number":104,"context_line":"    end"},{"line_number":105,"context_line":"    return res"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"fa32b979_ec7e5718","line":102,"updated":"2015-06-17 00:25:03.000000000","message":"I\u0027m not sure how ruby scoping works, but is it possible that token could be unset here?  e.g. Puppet::Provider::Openstack.request raises some unexpected exception.  The else clause will be hit without token being set?","commit_id":"7d5a70beacb86179389c46c9635a2bc2c1a263d7"},{"author":{"_account_id":6525,"name":"Gilles Dubreuil","email":"gilles@redhat.com","username":"q-1illes-a"},"change_message_id":"773b8829c7b8baaa1ca08935a42611dc0b0b5eaf","unresolved":false,"context_lines":[{"line_number":99,"context_line":"      rescue Puppet::Error::OpenstackUnauthorizedError"},{"line_number":100,"context_line":"        # password is invalid"},{"line_number":101,"context_line":"      else"},{"line_number":102,"context_line":"        res \u003d resource[:password] unless token.empty?"},{"line_number":103,"context_line":"      end"},{"line_number":104,"context_line":"    end"},{"line_number":105,"context_line":"    return res"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"fa32b979_fc15a63f","line":102,"in_reply_to":"fa32b979_ec7e5718","updated":"2015-06-17 01:48:00.000000000","message":"The else clause is only executed if there is nothing raised, it\u0027s the code that goes normally after the request but it\u0027s clearer. Now if an error is raised during the request it jumps directly to the rescue block, doing nothing, res will be return as it\u0027s nil default","commit_id":"7d5a70beacb86179389c46c9635a2bc2c1a263d7"}]}
