)]}'
{"lib/puppet/provider/neutron_agent_sriov_numvfs/sriov_numvfs.rb":[{"author":{"_account_id":6681,"name":"Brent Eagles","email":"beagles@redhat.com","username":"beagles"},"change_message_id":"4a3383b31ea082f10f92145a5976074d8d92b412","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"  def _update_persistent_data"},{"line_number":45,"context_line":"    if !File.exists?(persistent_config_path)"},{"line_number":46,"context_line":"      File.write(persistent_config_path, new_line_content)"},{"line_number":47,"context_line":"      File.chmod(0755,persistent_config_path)"},{"line_number":48,"context_line":"    else"},{"line_number":49,"context_line":"      found \u003d false"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"1ac06dbe_0ae7e8b0","line":46,"updated":"2016-08-22 16:12:25.000000000","message":"Does ifup-local need to have a shebang (e.g. #!/bin/sh) as the first line?","commit_id":"f8b741927466878d06f52ae355d59edbf195872c"},{"author":{"_account_id":18904,"name":"Karthik S","email":"ksundara@redhat.com","username":"karthiks"},"change_message_id":"67f9d1881cd291a1fd35fffcc99991f1159b7c0f","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"  def _update_persistent_data"},{"line_number":45,"context_line":"    if !File.exists?(persistent_config_path)"},{"line_number":46,"context_line":"      File.write(persistent_config_path, new_line_content)"},{"line_number":47,"context_line":"      File.chmod(0755,persistent_config_path)"},{"line_number":48,"context_line":"    else"},{"line_number":49,"context_line":"      found \u003d false"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"1ac06dbe_9ddda5e2","line":46,"in_reply_to":"1ac06dbe_0ae7e8b0","updated":"2016-08-23 13:00:24.000000000","message":"Done","commit_id":"f8b741927466878d06f52ae355d59edbf195872c"},{"author":{"_account_id":6681,"name":"Brent Eagles","email":"beagles@redhat.com","username":"beagles"},"change_message_id":"345d32cec3caef771d0cb24ebb9d350435887f49","unresolved":false,"context_lines":[{"line_number":46,"context_line":"  def _update_persistent_data"},{"line_number":47,"context_line":"    if !File.exists?(persistent_config_path)"},{"line_number":48,"context_line":"      File.write(persistent_config_path, \"#!/bin/sh\\n#{new_line_content}\")"},{"line_number":49,"context_line":"      File.chmod(0755,persistent_config_path)"},{"line_number":50,"context_line":"    else"},{"line_number":51,"context_line":"      found \u003d false"},{"line_number":52,"context_line":"      t_file \u003d Tempfile.new(\u0027numvfs_temp.txt\u0027)"}],"source_content_type":"text/x-ruby","patch_set":4,"id":"1ac06dbe_8a47b94a","line":49,"updated":"2016-08-24 17:11:24.000000000","message":"Ugh. Stig is right (good catch), this will be called for every up.\n\nYou could do the if/then thing, but it might be easier to do something like:\n\n[ \"#{sriov_get_interface}\" \u003d\u003d \"$1\" ] \u0026\u0026 #{echo statement}\n\nStig, thoughts?","commit_id":"31e23c3ac3fe83c8878a6a38f6fd6d039d57713e"},{"author":{"_account_id":6681,"name":"Brent Eagles","email":"beagles@redhat.com","username":"beagles"},"change_message_id":"40194bb57478012513632716230e5a38453e8b9c","unresolved":false,"context_lines":[{"line_number":52,"context_line":"      t_file \u003d Tempfile.new(\u0027numvfs_temp.txt\u0027)"},{"line_number":53,"context_line":"      File.open(persistent_config_path, \u0027r\u0027) do |f|"},{"line_number":54,"context_line":"        f.each_line do |line|"},{"line_number":55,"context_line":"          if line \u003d~ /^\\[ \\\"#{sriov_get_interface}\\\" \u003d\u003d \\\"\\$1\\\" \\] \\\u0026\\\u0026 echo [0-9]* \u003e #{sriov_numvfs_path}/"},{"line_number":56,"context_line":"            line \u003d new_line_content"},{"line_number":57,"context_line":"            found \u003d true"},{"line_number":58,"context_line":"          end"}],"source_content_type":"text/x-ruby","patch_set":5,"id":"1ac06dbe_f21bbf7e","line":55,"updated":"2016-08-24 18:50:40.000000000","message":"I wonder if you really need to grep the whole line? Wouldn\u0027t the first part do? Or maybe even encode the resource name in the comment and grep for that instead? What I\u0027m be concerned about is that it if we make this too delicate any alterations to the code is going to break this.\n\ne.g. if the generated line becomes something like\n\n[ \"eth4\" \u003d\u003d \"$1\" ] \u0026\u0026 echo 8 \u003e /sys/class/net/eth4/device/sriov_numvfs  # configured by puppet-neutron sriov_numvfs(eth4:8)\n\nand you grep for sriov_numvfs(eth4:[0-9]+) instead. \n\nThoughts?","commit_id":"9c5aa900352fc689f1685c9245573c1733ffd9de"},{"author":{"_account_id":10910,"name":"Stig Telfer","email":"stig.openstack@telfer.org","username":"stigtelfer"},"change_message_id":"cb99c64265bd4fac50d8ec1cc686cfeab819d9f7","unresolved":false,"context_lines":[{"line_number":52,"context_line":"      t_file \u003d Tempfile.new(\u0027numvfs_temp.txt\u0027)"},{"line_number":53,"context_line":"      File.open(persistent_config_path, \u0027r\u0027) do |f|"},{"line_number":54,"context_line":"        f.each_line do |line|"},{"line_number":55,"context_line":"          if line \u003d~ /^\\[ \\\"#{sriov_get_interface}\\\" \u003d\u003d \\\"\\$1\\\" \\] \\\u0026\\\u0026 echo [0-9]* \u003e #{sriov_numvfs_path}/"},{"line_number":56,"context_line":"            line \u003d new_line_content"},{"line_number":57,"context_line":"            found \u003d true"},{"line_number":58,"context_line":"          end"}],"source_content_type":"text/x-ruby","patch_set":5,"id":"1ac06dbe_a88c3880","line":55,"in_reply_to":"1ac06dbe_f21bbf7e","updated":"2016-08-24 19:21:31.000000000","message":"Matching on encoded text in the comment makes sense to me.  As you say, matching the expression could get brittle and is heavy on escaped characters.  In bash you only need the single \u0027\u003d\u0027 here - trim a character...","commit_id":"9c5aa900352fc689f1685c9245573c1733ffd9de"},{"author":{"_account_id":10910,"name":"Stig Telfer","email":"stig.openstack@telfer.org","username":"stigtelfer"},"change_message_id":"cb99c64265bd4fac50d8ec1cc686cfeab819d9f7","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        end"},{"line_number":64,"context_line":"      end"},{"line_number":65,"context_line":"      t_file.close"},{"line_number":66,"context_line":"      FileUtils.mv(t_file.path, persistent_config_path)"},{"line_number":67,"context_line":"    end"},{"line_number":68,"context_line":"  end"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-ruby","patch_set":5,"id":"1ac06dbe_e8b910cd","line":66,"updated":"2016-08-24 19:21:31.000000000","message":"I\u0027m not a ruby programmer but you might need to File.chmod the t_file.path before you move it to make it executable.  And is the ownership correct?","commit_id":"9c5aa900352fc689f1685c9245573c1733ffd9de"},{"author":{"_account_id":10910,"name":"Stig Telfer","email":"stig.openstack@telfer.org","username":"stigtelfer"},"change_message_id":"601dabd88b9d7ae21aceb09d4499bb75a87293e1","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"  def _update_persistent_data"},{"line_number":47,"context_line":"    if !File.exists?(persistent_config_path)"},{"line_number":48,"context_line":"      File.write(persistent_config_path, \"#!/bin/sh\\n#{new_line_content}\")"},{"line_number":49,"context_line":"    else"},{"line_number":50,"context_line":"      found \u003d false"},{"line_number":51,"context_line":"      t_file \u003d Tempfile.new(\u0027numvfs_temp.txt\u0027)"}],"source_content_type":"text/x-ruby","patch_set":6,"id":"1ac06dbe_5407fa1c","line":48,"range":{"start_line":48,"start_character":49,"end_line":48,"end_character":51},"updated":"2016-08-25 08:27:41.000000000","message":"You should either change this to bash or change the \u0027\u003d\u003d\u0027 on line 71 to \u0027\u003d\u0027 as per the previous comments: \u0027\u003d\u003d\u0027 as a string comparison operator I believe is a bashism.  I suggest you go with bash here unless you have a particular reason not to.","commit_id":"a2f7955a363f95761c35473e201f3414355ff0c0"}],"spec/unit/provider/neutron_agent_sriov_numvfs/sriov_numvfs_spec.rb":[{"author":{"_account_id":6681,"name":"Brent Eagles","email":"beagles@redhat.com","username":"beagles"},"change_message_id":"4a3383b31ea082f10f92145a5976074d8d92b412","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    it \u0027should return the correct numvfs value\u0027 do"},{"line_number":31,"context_line":"      expect(provider.sriov_numvfs_value).to eql(10)"},{"line_number":32,"context_line":"    end"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    it \u0027should return path of the file to enable vfs\u0027 do"},{"line_number":35,"context_line":"      expect(provider.sriov_numvfs_path).to eql(\u0027/sys/class/net/eth0/device/sriov_numvfs\u0027)"},{"line_number":36,"context_line":"    end"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"1ac06dbe_4a056078","line":33,"updated":"2016-08-22 16:12:25.000000000","message":"Since this patch modifies if-up, some tests that validate those modifications seem appropriate. Examples would be to provide some initial content with and without a matching line. Also the behavior if there are multiple matches on interface name (a case categorized as user error, but things shouldn\u0027t get \"out of hand if this happens ;)). An example of of a test that does something like this is https://github.com/openstack/puppet-tempest/blob/master/spec/unit/puppet/provider/ruby_spec.rb\n\nI think there may be some examples of other approaches in the other openstack modules, e.g. openstacklib","commit_id":"f8b741927466878d06f52ae355d59edbf195872c"},{"author":{"_account_id":18904,"name":"Karthik S","email":"ksundara@redhat.com","username":"karthiks"},"change_message_id":"67f9d1881cd291a1fd35fffcc99991f1159b7c0f","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    it \u0027should return the correct numvfs value\u0027 do"},{"line_number":31,"context_line":"      expect(provider.sriov_numvfs_value).to eql(10)"},{"line_number":32,"context_line":"    end"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    it \u0027should return path of the file to enable vfs\u0027 do"},{"line_number":35,"context_line":"      expect(provider.sriov_numvfs_path).to eql(\u0027/sys/class/net/eth0/device/sriov_numvfs\u0027)"},{"line_number":36,"context_line":"    end"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"1ac06dbe_9d04854a","line":33,"in_reply_to":"1ac06dbe_4a056078","updated":"2016-08-23 13:00:24.000000000","message":"Done","commit_id":"f8b741927466878d06f52ae355d59edbf195872c"},{"author":{"_account_id":6681,"name":"Brent Eagles","email":"beagles@redhat.com","username":"beagles"},"change_message_id":"33382469b0b6a88762e3e945c58b08c9a42e3d21","unresolved":false,"context_lines":[{"line_number":7,"context_line":""},{"line_number":8,"context_line":"describe provider_class do"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"  let(:test_cfg_path) { \"/tmp/test-ifup-local.txt\" }"},{"line_number":11,"context_line":"  let :numvfs_conf do"},{"line_number":12,"context_line":"    {"},{"line_number":13,"context_line":"      :name            \u003d\u003e \u0027eth0:10\u0027,"}],"source_content_type":"text/x-ruby","patch_set":4,"id":"1ac06dbe_2215449b","line":10,"updated":"2016-08-23 23:53:33.000000000","message":"I wonder if we ever run tests in a way that using a non-random generated name would be a problem? I\u0027m not sure that I\u0027ve seen other tests worry about this, so benefit of doubt on this one.","commit_id":"31e23c3ac3fe83c8878a6a38f6fd6d039d57713e"},{"author":{"_account_id":9524,"name":"JiXuefeng","email":"jixuefeng@awcloud.com","username":"jixf"},"change_message_id":"75b11b0cce307c79ba39087e545440532c41be85","unresolved":false,"context_lines":[{"line_number":10,"context_line":"  let(:test_cfg_path) { \"/tmp/test-ifup-local.txt\" }"},{"line_number":11,"context_line":"  let :numvfs_conf do"},{"line_number":12,"context_line":"    {"},{"line_number":13,"context_line":"      :name            \u003d\u003e \u0027eth0:10\u0027,"},{"line_number":14,"context_line":"      :ensure          \u003d\u003e \u0027present\u0027,"},{"line_number":15,"context_line":"    }"},{"line_number":16,"context_line":"  end"}],"source_content_type":"text/x-ruby","patch_set":7,"id":"1ac06dbe_437734d4","line":13,"range":{"start_line":13,"start_character":4,"end_line":13,"end_character":36},"updated":"2016-08-25 12:11:32.000000000","message":"Giving a description of \"eth:num\" would be better.","commit_id":"d8b3d5f0974f587de82257012502069e98e1561b"}]}
