)]}'
{"lib/puppet/provider/keystone.rb":[{"author":{"_account_id":6525,"name":"Gilles Dubreuil","email":"gilles@redhat.com","username":"q-1illes-a"},"change_message_id":"d1fc234de2996c5c51be301d3418ab22ffb2a2a1","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"  INI_FILENAME \u003d \u0027/etc/keystone/keystone.conf\u0027"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"  @@default_domain_id \u003d nil"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"  def self.admin_endpoint"},{"line_number":16,"context_line":"    @admin_endpoint ||\u003d get_admin_endpoint"}],"source_content_type":"text/x-ruby","patch_set":1,"id":"da20952f_62fe47b0","line":13,"updated":"2015-09-08 12:16:03.000000000","message":"This can be avoided, see below","commit_id":"86672c1495c086767dc115a0952dd5e800134fc5"},{"author":{"_account_id":6525,"name":"Gilles Dubreuil","email":"gilles@redhat.com","username":"q-1illes-a"},"change_message_id":"d1fc234de2996c5c51be301d3418ab22ffb2a2a1","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"  def self.default_domain_id\u003d(id)"},{"line_number":50,"context_line":"    @@default_domain_id \u003d id"},{"line_number":51,"context_line":"  end"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"  def self.domain_name_from_id(id)"},{"line_number":54,"context_line":"    unless @domain_hash"}],"source_content_type":"text/x-ruby","patch_set":1,"id":"da20952f_2207ef82","line":51,"updated":"2015-09-08 12:16:03.000000000","message":"For even more clarity I would suggest replacing above change with: \n\ndef self.fetch_default_domain_id\n  if keystone_file and keystone_file[\u0027identity\u0027] and keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027]\n    keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027].strip\n  else\n    \u0027default\u0027\n  end\nend\n\ndef self.default_domain_id\n  @@default_domain_id ||\u003d fetch_default_domain_id\nend","commit_id":"86672c1495c086767dc115a0952dd5e800134fc5"},{"author":{"_account_id":9983,"name":"Richard Megginson","email":"rmeggins@redhat.com","username":"rmeggins"},"change_message_id":"7edb861f935fa8fc83c397171b4d4ac16a04b8a3","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"  def self.default_domain_id\u003d(id)"},{"line_number":50,"context_line":"    @@default_domain_id \u003d id"},{"line_number":51,"context_line":"  end"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"  def self.domain_name_from_id(id)"},{"line_number":54,"context_line":"    unless @domain_hash"}],"source_content_type":"text/x-ruby","patch_set":1,"id":"da20952f_3e429169","line":51,"in_reply_to":"da20952f_1e478d1e","updated":"2015-09-08 23:05:43.000000000","message":"Yes, that should work too, but that change seemed too invasive.  I\u0027m assuming there was a good reason why @keystone_file was implemented as a class instance variable.","commit_id":"86672c1495c086767dc115a0952dd5e800134fc5"},{"author":{"_account_id":9983,"name":"Richard Megginson","email":"rmeggins@redhat.com","username":"rmeggins"},"change_message_id":"baa8f4e0d2842c7d4f2b5297cef6addddd836b6f","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"  def self.default_domain_id\u003d(id)"},{"line_number":50,"context_line":"    @@default_domain_id \u003d id"},{"line_number":51,"context_line":"  end"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"  def self.domain_name_from_id(id)"},{"line_number":54,"context_line":"    unless @domain_hash"}],"source_content_type":"text/x-ruby","patch_set":1,"id":"da20952f_acf44ecf","line":51,"in_reply_to":"da20952f_2207ef82","updated":"2015-09-08 14:21:08.000000000","message":"I tried something like that - it doesn\u0027t work.  The problem is that the keystone_file returns the @keystone_file class instance variable, which is local to each instance of the Puppet::Provider::Keystone class - so each Keystone_domain, Keystone_tenant, Keystone_user, etc. has their own local copy of @keystone_file.  What we would have to do is reload @keystone_file every time we issue a lookup for `default_domain_id`, because otherwise, how do we know when Keystone_domain has written it?\n\nIn my testing, I put traces in keystone_file to see when each class instantiated @keystone_file.  For the resources corresponding to the domain scoped resources, such as Keystone_tenant, Keystone_user, Keystone_user_role, @keystone_file was instantiated and keystone.conf read into it, BEFORE Keystone_domain wrote default_domain_id, at least using the basic_acceptance_spec.rb test.  This means, using keystone_file is not reliable.\n\nHence this approach.  When default_domain_id is explicitly set by Keystone_domain, `@@default_domain_id` will be used from that point on, in _all_ of the classes.  If it has not been set, see if it was set in keystone_file.  Otherwise, just use \u0027default\u0027.","commit_id":"86672c1495c086767dc115a0952dd5e800134fc5"},{"author":{"_account_id":6525,"name":"Gilles Dubreuil","email":"gilles@redhat.com","username":"q-1illes-a"},"change_message_id":"79f5455ae21c775f072fdcdc8682e1e863941a73","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"  def self.default_domain_id\u003d(id)"},{"line_number":50,"context_line":"    @@default_domain_id \u003d id"},{"line_number":51,"context_line":"  end"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"  def self.domain_name_from_id(id)"},{"line_number":54,"context_line":"    unless @domain_hash"}],"source_content_type":"text/x-ruby","patch_set":1,"id":"da20952f_4958ed8a","line":51,"in_reply_to":"da20952f_3e429169","updated":"2015-09-08 23:38:37.000000000","message":"Fair enough, that\u0027s would have been great though.","commit_id":"86672c1495c086767dc115a0952dd5e800134fc5"},{"author":{"_account_id":6525,"name":"Gilles Dubreuil","email":"gilles@redhat.com","username":"q-1illes-a"},"change_message_id":"d1d2bdc318bb03b3c83a891db24c9a417d724e32","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"  def self.default_domain_id\u003d(id)"},{"line_number":50,"context_line":"    @@default_domain_id \u003d id"},{"line_number":51,"context_line":"  end"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"  def self.domain_name_from_id(id)"},{"line_number":54,"context_line":"    unless @domain_hash"}],"source_content_type":"text/x-ruby","patch_set":1,"id":"da20952f_1e478d1e","line":51,"in_reply_to":"da20952f_acf44ecf","updated":"2015-09-08 22:37:22.000000000","message":"I see what you mean, thanks for the detailed explanation.\nWouldn\u0027t it make sense to have keystone_file to return a class variable instead?","commit_id":"86672c1495c086767dc115a0952dd5e800134fc5"},{"author":{"_account_id":8297,"name":"Sofer Athlan-Guyot","email":"sathlang@redhat.com","username":"chem"},"change_message_id":"18df7b691f0bbf376d809accef8e9c5e12c8262c","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"  def self.default_domain_id"},{"line_number":40,"context_line":"    if @@default_domain_id"},{"line_number":41,"context_line":"      @@default_domain_id"},{"line_number":42,"context_line":"    elsif keystone_file and keystone_file[\u0027identity\u0027] and keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027]"},{"line_number":43,"context_line":"      keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027].strip"},{"line_number":44,"context_line":"    else"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"da20952f_f7d98e23","line":41,"updated":"2015-09-09 09:59:27.000000000","message":"Not sure I understand the usefulness of keystone_file here.  We could you indirection to retrieve the value in the config file.  It make yet another idiom (sorry it\u0027s not your patch but as we changing this ...)\n\n    def_domain_id \u003d Puppet::Resource.indirection.find(\u0027Keystone_config/identity/default_domain_id\u0027)[:value]\n    def_domain_id !\u003d :absent ? def_domain_id : \u0027default\u0027","commit_id":"f7c8fc2ffa15272548623c1f58be0e007e5a16be"},{"author":{"_account_id":8297,"name":"Sofer Athlan-Guyot","email":"sathlang@redhat.com","username":"chem"},"change_message_id":"8190fbd9f95513d598f4bd8a906fbf7f70fd339e","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"  def self.default_domain_id"},{"line_number":40,"context_line":"    if @@default_domain_id"},{"line_number":41,"context_line":"      @@default_domain_id"},{"line_number":42,"context_line":"    elsif keystone_file and keystone_file[\u0027identity\u0027] and keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027]"},{"line_number":43,"context_line":"      keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027].strip"},{"line_number":44,"context_line":"    else"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"da20952f_05ee43b4","line":41,"in_reply_to":"da20952f_028f19cd","updated":"2015-09-09 13:20:26.000000000","message":"The indirection will check the configuration file when it is called so no problem with the \"on the fly\" part.  \n\nAs for the performance, here, it\u0027s not as in the bug where a lot of objects are created.  It\u0027s only file parsing done by keystone_config/ini_settings and return a hash.\n\nAs for passing parameter I\u0027m not sure I understand, but you can definitively do \n\n  .find(\u0027Keystone_config/identity/domain_config_dir\u0027)\n\nIs that what you meant ?\n\nAs for a direct osc request, it will be available only if the kestone server has been restarted, which may not be the case as this notification will be delayed till the end of the puppet run.  The config file should be more reliable especially if you autorequire the Keystone_config(\u0027identity/default_domain_id\u0027) resource.","commit_id":"f7c8fc2ffa15272548623c1f58be0e007e5a16be"},{"author":{"_account_id":9983,"name":"Richard Megginson","email":"rmeggins@redhat.com","username":"rmeggins"},"change_message_id":"f38eebd03859da49208811d72867dcb7fc1324ba","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"  def self.default_domain_id"},{"line_number":40,"context_line":"    if @@default_domain_id"},{"line_number":41,"context_line":"      @@default_domain_id"},{"line_number":42,"context_line":"    elsif keystone_file and keystone_file[\u0027identity\u0027] and keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027]"},{"line_number":43,"context_line":"      keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027].strip"},{"line_number":44,"context_line":"    else"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"da20952f_55d5c418","line":41,"in_reply_to":"da20952f_05ee43b4","updated":"2015-09-09 15:33:21.000000000","message":"Will indirection read from keystone_file every time?  If we do not use @@default_domain_id, what will happen when default_domain_id is changed _after_ keystone_file is read?\n\nThe indirection performance problems are really only with objects returned by OSC, and the way that RAL uses self.instances.  There may not be a performance problem with Keystone_config, as long as it doesn\u0027t try to read from keystone.conf for every single call.  And if it doesn\u0027t read every time, then it might miss updates to default_domain_id or other parameters.\n\nI\u0027m not against using keystone_config/indirection, but it works now, and the implementation is fairly simple, so unless there is a problem with the current implementation, I don\u0027t feel that it is necessary to change it.","commit_id":"f7c8fc2ffa15272548623c1f58be0e007e5a16be"},{"author":{"_account_id":6525,"name":"Gilles Dubreuil","email":"gilles@redhat.com","username":"q-1illes-a"},"change_message_id":"34ead8168a4a1c59c6ebc58cc384ab55cdbbe948","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"  def self.default_domain_id"},{"line_number":40,"context_line":"    if @@default_domain_id"},{"line_number":41,"context_line":"      @@default_domain_id"},{"line_number":42,"context_line":"    elsif keystone_file and keystone_file[\u0027identity\u0027] and keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027]"},{"line_number":43,"context_line":"      keystone_file[\u0027identity\u0027][\u0027default_domain_id\u0027].strip"},{"line_number":44,"context_line":"    else"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"da20952f_028f19cd","line":41,"in_reply_to":"da20952f_f7d98e23","updated":"2015-09-09 12:18:13.000000000","message":"We need to check keystone file because the default domain id could be changed on the fly.\n\nWe also know that indirection has issues, not as efficient as initially thought and not fulfilling the requirements to be able to pass parameter (such as the domain). Please see bug/1493450.\n\nAlso it seems indirection for resources is limited to internal use:  \nhttps://docs.puppetlabs.com/references/latest/indirection.html#ral-terminus\n\nThis is why indirection are to be replaced by direct OSC requests in a review commit very soon.","commit_id":"f7c8fc2ffa15272548623c1f58be0e007e5a16be"}],"spec/unit/provider/keystone_spec.rb":[{"author":{"_account_id":8297,"name":"Sofer Athlan-Guyot","email":"sathlang@redhat.com","username":"chem"},"change_message_id":"18df7b691f0bbf376d809accef8e9c5e12c8262c","unresolved":false,"context_lines":[{"line_number":231,"context_line":"\u0027)"},{"line_number":232,"context_line":"      expect(klass.name_and_domain(\u0027foo\u0027)).to eq([\u0027foo\u0027, \u0027SomeName\u0027])"},{"line_number":233,"context_line":"    end"},{"line_number":234,"context_line":"    it \u0027should return the default_domain_id from one class set in another class\u0027 do"},{"line_number":235,"context_line":"      ENV[\u0027OS_USERNAME\u0027]     \u003d \u0027test\u0027"},{"line_number":236,"context_line":"      ENV[\u0027OS_PASSWORD\u0027]     \u003d \u0027abc123\u0027"},{"line_number":237,"context_line":"      ENV[\u0027OS_PROJECT_NAME\u0027] \u003d \u0027test\u0027"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"da20952f_b72f96a6","line":234,"updated":"2015-09-09 09:59:27.000000000","message":"Better refactore this and the next env setting in a let(:set_env) and use set_env before your test.","commit_id":"f7c8fc2ffa15272548623c1f58be0e007e5a16be"},{"author":{"_account_id":8297,"name":"Sofer Athlan-Guyot","email":"sathlang@redhat.com","username":"chem"},"change_message_id":"8190fbd9f95513d598f4bd8a906fbf7f70fd339e","unresolved":false,"context_lines":[{"line_number":231,"context_line":"\u0027)"},{"line_number":232,"context_line":"      expect(klass.name_and_domain(\u0027foo\u0027)).to eq([\u0027foo\u0027, \u0027SomeName\u0027])"},{"line_number":233,"context_line":"    end"},{"line_number":234,"context_line":"    it \u0027should return the default_domain_id from one class set in another class\u0027 do"},{"line_number":235,"context_line":"      ENV[\u0027OS_USERNAME\u0027]     \u003d \u0027test\u0027"},{"line_number":236,"context_line":"      ENV[\u0027OS_PASSWORD\u0027]     \u003d \u0027abc123\u0027"},{"line_number":237,"context_line":"      ENV[\u0027OS_PROJECT_NAME\u0027] \u003d \u0027test\u0027"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"da20952f_4522fb02","line":234,"in_reply_to":"da20952f_621e1561","updated":"2015-09-09 13:20:26.000000000","message":"Ack.  I can start this today and rebase if conflict emerge from those patches.","commit_id":"f7c8fc2ffa15272548623c1f58be0e007e5a16be"},{"author":{"_account_id":6525,"name":"Gilles Dubreuil","email":"gilles@redhat.com","username":"q-1illes-a"},"change_message_id":"34ead8168a4a1c59c6ebc58cc384ab55cdbbe948","unresolved":false,"context_lines":[{"line_number":231,"context_line":"\u0027)"},{"line_number":232,"context_line":"      expect(klass.name_and_domain(\u0027foo\u0027)).to eq([\u0027foo\u0027, \u0027SomeName\u0027])"},{"line_number":233,"context_line":"    end"},{"line_number":234,"context_line":"    it \u0027should return the default_domain_id from one class set in another class\u0027 do"},{"line_number":235,"context_line":"      ENV[\u0027OS_USERNAME\u0027]     \u003d \u0027test\u0027"},{"line_number":236,"context_line":"      ENV[\u0027OS_PASSWORD\u0027]     \u003d \u0027abc123\u0027"},{"line_number":237,"context_line":"      ENV[\u0027OS_PROJECT_NAME\u0027] \u003d \u0027test\u0027"}],"source_content_type":"text/x-ruby","patch_set":2,"id":"da20952f_621e1561","line":234,"in_reply_to":"da20952f_b72f96a6","updated":"2015-09-09 12:18:13.000000000","message":"As I mentioned/replied in review 221119/2, I agreed but I think a separate patch would help us moving faster.","commit_id":"f7c8fc2ffa15272548623c1f58be0e007e5a16be"}]}
