)]}'
{"nova/tests/virt/xenapi/client/__init__.py":[{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"e5a59adb49516fc9142b11cc353fae826bc79c42","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# All Rights Reserved."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FqAY%3D","line":1,"updated":"2014-02-11 18:02:07.000000000","message":"Missing the owner field.","commit_id":"a7bc6accf6f9f995c93fb777f7eddb8f2403c5b4"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6d2f9c4729b3ae2d049aabab8aae649b267b55e9","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# All Rights Reserved."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FeRM%3D","line":1,"in_reply_to":"AAAAUX%2F%2FqAY%3D","updated":"2014-02-12 23:22:49.000000000","message":"Yeah, I got confused about if we need it. I will add in the foundation one.","commit_id":"a7bc6accf6f9f995c93fb777f7eddb8f2403c5b4"},{"author":{"_account_id":8430,"name":"Christopher Lefelhocz","email":"christopher.lefelhoc@rackspace.com","username":"leif"},"change_message_id":"b685ff240e18dc63fdf9d1cb5c917d0a95c1ca3b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 Rackspace Hosting"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVX%2F%2F5U0%3D","line":1,"updated":"2014-02-27 14:54:07.000000000","message":"According to http://docs.openstack.org/developer/hacking/#openstack-licensing we shouldn\u0027t have the licensing statement in here.","commit_id":"acd00a885b30d7107c02ee2c9019197a2fdd87e5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"98ebcab16202ced60d3551b0033d4ce00e7dc0b7","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 Rackspace Hosting"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVX%2F%2F5G8%3D","line":1,"in_reply_to":"AAAAVX%2F%2F5U0%3D","updated":"2014-02-27 15:07:31.000000000","message":"cool, its official now.","commit_id":"acd00a885b30d7107c02ee2c9019197a2fdd87e5"}],"nova/tests/virt/xenapi/client/test_objects.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"14f39dbedacde4fc656bb5689e86f6b8c6e6f546","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        self.assertEqual(result, None)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_get_all_refs_and_recs(self):"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        def fake_call_xenapi(*args):"},{"line_number":60,"context_line":"            ref \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BdQ%3D","line":57,"updated":"2014-01-31 13:57:08.000000000","message":"Remove this along with the get_all_refs_and_recs call.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"7e976285659b817c2a8662dda9b2f992aad73c41","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        self.assertEqual(result, None)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_get_all_refs_and_recs(self):"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        def fake_call_xenapi(*args):"},{"line_number":60,"context_line":"            ref \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BMc%3D","line":57,"in_reply_to":"AAAAUH%2F9%2BSs%3D","updated":"2014-01-31 14:53:29.000000000","message":"Then just replace the body with a test that .get_all_records is called","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b9a8bbc2bee643936a55a7a07e661790c432d56","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        self.assertEqual(result, None)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_get_all_refs_and_recs(self):"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        def fake_call_xenapi(*args):"},{"line_number":60,"context_line":"            ref \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BSs%3D","line":57,"in_reply_to":"AAAAUH%2F9%2BdQ%3D","updated":"2014-01-31 14:29:04.000000000","message":"It is still being used in the current code, for SR.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"14f39dbedacde4fc656bb5689e86f6b8c6e6f546","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    @mock.patch.object(objects.VM, \u0027_try_strip_base_mirror_from_vdi\u0027)"},{"line_number":99,"context_line":"    def test_strip_base_mirror_from_vdis_old_test(self, mock_strip):"},{"line_number":100,"context_line":"        self.session.call_xenapi.return_value \u003d {\"VDI\": \"ref\", \"foo\": \"bar\"}"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self.VM.strip_base_mirror_from_vdis(\"vm_ref\")"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2Bc8%3D","line":100,"updated":"2014-01-31 13:57:08.000000000","message":"Can we not now avoid this with mocking objects.VM.get_VBDs?","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b9a8bbc2bee643936a55a7a07e661790c432d56","unresolved":false,"context_lines":[{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    @mock.patch.object(objects.VM, \u0027_try_strip_base_mirror_from_vdi\u0027)"},{"line_number":99,"context_line":"    def test_strip_base_mirror_from_vdis_old_test(self, mock_strip):"},{"line_number":100,"context_line":"        self.session.call_xenapi.return_value \u003d {\"VDI\": \"ref\", \"foo\": \"bar\"}"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self.VM.strip_base_mirror_from_vdis(\"vm_ref\")"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BTA%3D","line":100,"in_reply_to":"AAAAUH%2F9%2Bc8%3D","updated":"2014-01-31 14:29:04.000000000","message":"this is an old test, didn\u0027t want to change it.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"14f39dbedacde4fc656bb5689e86f6b8c6e6f546","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        expected \u003d [mock.call(\u0027VM.get_VBDs\u0027, \"vm_ref\"),"},{"line_number":105,"context_line":"                    mock.call(\u0027VBD.get_record\u0027, \"VDI\"),"},{"line_number":106,"context_line":"                    mock.call(\u0027VBD.get_record\u0027, \"foo\")]"},{"line_number":107,"context_line":"        self.assertEqual(expected, self.session.call_xenapi.call_args_list)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        expected \u003d [mock.call(\"ref\"), mock.call(\"ref\")]"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2Bc4%3D","line":106,"updated":"2014-01-31 13:57:08.000000000","message":"This smells - it\u0027s using the call_xenapi.return_value in two ways (here and @ line 109) and makes for a very confusing test.\n\nDefinitely fix this so the test makes sense rather than (ab)using call_xenapi having a single return value for multiple calls","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"7e976285659b817c2a8662dda9b2f992aad73c41","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        expected \u003d [mock.call(\u0027VM.get_VBDs\u0027, \"vm_ref\"),"},{"line_number":105,"context_line":"                    mock.call(\u0027VBD.get_record\u0027, \"VDI\"),"},{"line_number":106,"context_line":"                    mock.call(\u0027VBD.get_record\u0027, \"foo\")]"},{"line_number":107,"context_line":"        self.assertEqual(expected, self.session.call_xenapi.call_args_list)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        expected \u003d [mock.call(\"ref\"), mock.call(\"ref\")]"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BKw%3D","line":106,"in_reply_to":"AAAAUH%2F9%2BTE%3D","updated":"2014-01-31 14:53:29.000000000","message":"I\u0027d argue that this should be removed and just keep the test below.  In fact, this test is definitely inferior to the one below because it only checks that strip was called twice, rather than it was called for two VBDs...\n\nI don\u0027t think there is benefit in saying the old tests still pass when we are adding a new and better test for the same behaviour.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b9a8bbc2bee643936a55a7a07e661790c432d56","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        expected \u003d [mock.call(\u0027VM.get_VBDs\u0027, \"vm_ref\"),"},{"line_number":105,"context_line":"                    mock.call(\u0027VBD.get_record\u0027, \"VDI\"),"},{"line_number":106,"context_line":"                    mock.call(\u0027VBD.get_record\u0027, \"foo\")]"},{"line_number":107,"context_line":"        self.assertEqual(expected, self.session.call_xenapi.call_args_list)"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"        expected \u003d [mock.call(\"ref\"), mock.call(\"ref\")]"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BTE%3D","line":106,"in_reply_to":"AAAAUH%2F9%2Bc4%3D","updated":"2014-01-31 14:29:04.000000000","message":"This is an existing test, I made a better test below. Wanted to show the old tests still pass.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"7e976285659b817c2a8662dda9b2f992aad73c41","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            if ref \u003d\u003d \"vbd_ref_2\":"},{"line_number":121,"context_line":"                return {\"VDI\": \"vdi_ref_2\"}"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        self.session.call_xenapi.side_effect \u003d fake_call_xenapi"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        self.VM.strip_base_mirror_from_vdis(\"vm_ref\")"},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BLo%3D","line":123,"updated":"2014-01-31 14:53:29.000000000","message":"If this is a new test, it should use the new approach of self.session.VM.get_VBDs.return_value \u003d [\u0027vbd_ref_1\u0027, \u0027vbd_ref_2\u0027]?\n\nI don\u0027t see any benefit in showing we can still write new tests in the old way as long as the other tests which haven\u0027t been converted yet still pass.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"e5a59adb49516fc9142b11cc353fae826bc79c42","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# All Rights Reserved."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FqAM%3D","line":1,"updated":"2014-02-11 18:02:07.000000000","message":"Missing owner field","commit_id":"a7bc6accf6f9f995c93fb777f7eddb8f2403c5b4"}],"nova/tests/virt/xenapi/client/test_session.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"af5b66bf24a44116aeaeea1f217f4df19730d1b0","unresolved":false,"context_lines":[{"line_number":22,"context_line":"class ApplySessionHelpersTestCase(stubs.XenAPITestBaseNoDB):"},{"line_number":23,"context_line":"    def setUp(self):"},{"line_number":24,"context_line":"        super(ApplySessionHelpersTestCase, self).setUp()"},{"line_number":25,"context_line":"        self.session \u003d mock.Mock()"},{"line_number":26,"context_line":"        session.apply_session_helpers(self.session)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def test_apply_session_helpers_add_VM(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVX%2F%2F5FE%3D","line":25,"updated":"2014-02-27 15:10:01.000000000","message":"session \u003d session.XenAPISession()\nmock.Mock(spec\u003dsession)\n\nThis will give you a Mock instance with the session helpers set.  (The instance adopts the attribute dictionary of the spec object)","commit_id":"acd00a885b30d7107c02ee2c9019197a2fdd87e5"}],"nova/tests/virt/xenapi/test_vm_utils.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"3a27d326e397399e8a758a3656fac7254c07541a","unresolved":false,"context_lines":[{"line_number":1507,"context_line":""},{"line_number":1508,"context_line":"        vm_utils.destroy_vm(session, instance, \"vm_ref\")"},{"line_number":1509,"context_line":""},{"line_number":1510,"context_line":"        session.call_xenapi.assert_called_once_with(\"VM.destroy\", \"vm_ref\")"},{"line_number":1511,"context_line":""},{"line_number":1512,"context_line":"    def test_destroy_vm_silently_fails(self, mock_extract):"},{"line_number":1513,"context_line":"        session \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FY5s%3D","line":1510,"updated":"2014-01-14 10:01:40.000000000","message":"I think call_xenapi is the wrong thing to test here.\nWe should have:\nsession.VM.destroy \u003d mock.Mock()\n...\nsession.VM.destroy.assert_called_once_with(\"vm_ref\")","commit_id":"eb47483f69c305ddfc0c617b6edb213e659cb60c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"14f39dbedacde4fc656bb5689e86f6b8c6e6f546","unresolved":false,"context_lines":[{"line_number":1517,"context_line":"        session \u003d mock.Mock()"},{"line_number":1518,"context_line":"        exc \u003d test.TestingException()"},{"line_number":1519,"context_line":"        session.XenAPI.Failure \u003d test.TestingException"},{"line_number":1520,"context_line":"        session.VM.destroy.side_effect \u003d exc"},{"line_number":1521,"context_line":"        instance \u003d {"},{"line_number":1522,"context_line":"            \"uuid\": \"uuid\","},{"line_number":1523,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BcM%3D","line":1520,"updated":"2014-01-31 13:57:08.000000000","message":"Woohoo! We can now use sensible syntax!","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":8430,"name":"Christopher Lefelhocz","email":"christopher.lefelhoc@rackspace.com","username":"leif"},"change_message_id":"13c0af71da536f6c46b6ad74158aa6f8b9765736","unresolved":false,"context_lines":[{"line_number":1436,"context_line":"class CreateVmTestCase(VMUtilsTestBase):"},{"line_number":1437,"context_line":"    def test_vss_provider(self, mock_extract):"},{"line_number":1438,"context_line":"        self.flags(vcpu_pin_set\u003d\"2,3\")"},{"line_number":1439,"context_line":"        session \u003d mock.Mock()"},{"line_number":1440,"context_line":"        objects.apply_session_helpers(session)"},{"line_number":1441,"context_line":"        instance \u003d {"},{"line_number":1442,"context_line":"            \"uuid\": \"uuid\", \"os_type\": \"windows\""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUX%2F%2FPdk%3D","line":1439,"updated":"2014-02-14 15:49:38.000000000","message":"Given the number of places that need to change.  It seems like making this session mock creation and apply_session_helpers a single call would make sense.","commit_id":"ecfd1bb84fe4b353cfddfcd89600eade82add188"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2b25c5071c3fda6b0ed5f8545ddc116a488668b5","unresolved":false,"context_lines":[{"line_number":1436,"context_line":"class CreateVmTestCase(VMUtilsTestBase):"},{"line_number":1437,"context_line":"    def test_vss_provider(self, mock_extract):"},{"line_number":1438,"context_line":"        self.flags(vcpu_pin_set\u003d\"2,3\")"},{"line_number":1439,"context_line":"        session \u003d mock.Mock()"},{"line_number":1440,"context_line":"        objects.apply_session_helpers(session)"},{"line_number":1441,"context_line":"        instance \u003d {"},{"line_number":1442,"context_line":"            \"uuid\": \"uuid\", \"os_type\": \"windows\""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2FzQY%3D","line":1439,"in_reply_to":"AAAAU3%2F%2FzVk%3D","updated":"2014-02-24 18:32:16.000000000","message":"Ah hang on, yes, this was hopefully only a transition towards the nicer style of test you see below.\n\nI knew there was a plan.\n\nBut I am cool pulling this out if that works out better.","commit_id":"ecfd1bb84fe4b353cfddfcd89600eade82add188"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e4b08465d16a44557c06948033594c332048a3f4","unresolved":false,"context_lines":[{"line_number":1436,"context_line":"class CreateVmTestCase(VMUtilsTestBase):"},{"line_number":1437,"context_line":"    def test_vss_provider(self, mock_extract):"},{"line_number":1438,"context_line":"        self.flags(vcpu_pin_set\u003d\"2,3\")"},{"line_number":1439,"context_line":"        session \u003d mock.Mock()"},{"line_number":1440,"context_line":"        objects.apply_session_helpers(session)"},{"line_number":1441,"context_line":"        instance \u003d {"},{"line_number":1442,"context_line":"            \"uuid\": \"uuid\", \"os_type\": \"windows\""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2FzVk%3D","line":1439,"in_reply_to":"AAAAUX%2F%2FPdk%3D","updated":"2014-02-24 18:09:45.000000000","message":"There is already one of those, but its a fake not a mock.Mock() instance.\n\nIt seemed confusing to have two, but I can\u0027t decide.","commit_id":"ecfd1bb84fe4b353cfddfcd89600eade82add188"}],"nova/virt/xenapi/client/objects.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"14f39dbedacde4fc656bb5689e86f6b8c6e6f546","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                raise"},{"line_number":74,"context_line":"        return None"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def get_all_refs_and_recs(self):"},{"line_number":77,"context_line":"        \"\"\"Retrieve all refs and recs for a Xen record type."},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        Use with caution, get_all_records_where is often more appropriate."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2Bd0%3D","line":76,"updated":"2014-01-31 13:57:08.000000000","message":"Why have you added this?\nPeople should use the standard method not have this custom coded here...\n\nSee https://review.openstack.org/#/c/58754/","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"7e976285659b817c2a8662dda9b2f992aad73c41","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                raise"},{"line_number":74,"context_line":"        return None"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def get_all_refs_and_recs(self):"},{"line_number":77,"context_line":"        \"\"\"Retrieve all refs and recs for a Xen record type."},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        Use with caution, get_all_records_where is often more appropriate."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BNs%3D","line":76,"in_reply_to":"AAAAUH%2F9%2BSY%3D","updated":"2014-01-31 14:53:29.000000000","message":"If it\u0027s still being used, then leave it where it was in session - unless we change where it is being called, and if we change that we might as well use the better get_all_records method.\n\nIt\u0027s a bad method to have, and therefore shouldn\u0027t be an example of how to use the base class.\n\nIt\u0027s also definitely a regression from the merged changeset I linked above.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b9a8bbc2bee643936a55a7a07e661790c432d56","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                raise"},{"line_number":74,"context_line":"        return None"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def get_all_refs_and_recs(self):"},{"line_number":77,"context_line":"        \"\"\"Retrieve all refs and recs for a Xen record type."},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        Use with caution, get_all_records_where is often more appropriate."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BSY%3D","line":76,"in_reply_to":"AAAAUH%2F9%2Bd0%3D","updated":"2014-01-31 14:29:04.000000000","message":"Sure, but its still being used in the code. I moved it here from session, to prove how this could be used.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"14f39dbedacde4fc656bb5689e86f6b8c6e6f546","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    def __init__(self, session):"},{"line_number":95,"context_line":"        super(VM, self).__init__(session, \"VM\")"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def strip_base_mirror_from_vdis(self, vm_ref):"},{"line_number":98,"context_line":"        # NOTE(johngarbutt) part of workaround for XenServer bug CA-98606"},{"line_number":99,"context_line":"        vbd_refs \u003d self.get_VBDs(vm_ref)"},{"line_number":100,"context_line":"        for vbd_ref in vbd_refs:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2Bdg%3D","line":97,"updated":"2014-01-31 13:57:08.000000000","message":"I\u0027m not sure this belongs here - that implies it\u0027s part of the API.\n\nHaving this method here suggests that a lot of things should move here - such as the destroy_sr call which detaches VBDs etc\n\nI don\u0027t think this should part of the same change","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"96b5398c35ccbf2b9075006c61c4d05fe1a734fc","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    def __init__(self, session):"},{"line_number":95,"context_line":"        super(VM, self).__init__(session, \"VM\")"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def strip_base_mirror_from_vdis(self, vm_ref):"},{"line_number":98,"context_line":"        # NOTE(johngarbutt) part of workaround for XenServer bug CA-98606"},{"line_number":99,"context_line":"        vbd_refs \u003d self.get_VBDs(vm_ref)"},{"line_number":100,"context_line":"        for vbd_ref in vbd_refs:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9oaE%3D","line":97,"in_reply_to":"AAAAUH%2F9%2BNY%3D","updated":"2014-02-05 14:31:06.000000000","message":"For SR.scan we are locking on the SR_ref.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"7e976285659b817c2a8662dda9b2f992aad73c41","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    def __init__(self, session):"},{"line_number":95,"context_line":"        super(VM, self).__init__(session, \"VM\")"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def strip_base_mirror_from_vdis(self, vm_ref):"},{"line_number":98,"context_line":"        # NOTE(johngarbutt) part of workaround for XenServer bug CA-98606"},{"line_number":99,"context_line":"        vbd_refs \u003d self.get_VBDs(vm_ref)"},{"line_number":100,"context_line":"        for vbd_ref in vbd_refs:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BNY%3D","line":97,"in_reply_to":"AAAAUH%2F9%2BR8%3D","updated":"2014-01-31 14:53:29.000000000","message":"What would you do for SR.scan that isn\u0027t in the base method?  I assume what we\u0027re trying to show here is a useful extension to the API or replacing of an existing API method with something that is more OpenStack friendly?","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b9a8bbc2bee643936a55a7a07e661790c432d56","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    def __init__(self, session):"},{"line_number":95,"context_line":"        super(VM, self).__init__(session, \"VM\")"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def strip_base_mirror_from_vdis(self, vm_ref):"},{"line_number":98,"context_line":"        # NOTE(johngarbutt) part of workaround for XenServer bug CA-98606"},{"line_number":99,"context_line":"        vbd_refs \u003d self.get_VBDs(vm_ref)"},{"line_number":100,"context_line":"        for vbd_ref in vbd_refs:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BR8%3D","line":97,"in_reply_to":"AAAAUH%2F9%2Bdg%3D","updated":"2014-01-31 14:29:04.000000000","message":"Yeah, maybe.\n\nI kinda want someone to put all the very simple VM related utilities, this seems like a good place.\n\nI would have moved vbd_attach or vbd_detatch, but it shouldn\u0027t be done in a single change. Maybe SR.scan would do the trick?","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"61fd4017300cf718854a636818560427a79ca499","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    def __init__(self, session):"},{"line_number":95,"context_line":"        super(VM, self).__init__(session, \"VM\")"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    def strip_base_mirror_from_vdis(self, vm_ref):"},{"line_number":98,"context_line":"        # NOTE(johngarbutt) part of workaround for XenServer bug CA-98606"},{"line_number":99,"context_line":"        vbd_refs \u003d self.get_VBDs(vm_ref)"},{"line_number":100,"context_line":"        for vbd_ref in vbd_refs:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9nHk%3D","line":97,"in_reply_to":"AAAAUH%2F9oaE%3D","updated":"2014-02-05 17:23:20.000000000","message":"FWIW, I think having a place to put the simple VM related utilities is how we ended up with the monolith that is vm_utils in the first place.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"14f39dbedacde4fc656bb5689e86f6b8c6e6f546","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    session.SR \u003d SR(session)"},{"line_number":139,"context_line":"    session.VDI \u003d VDI(session)"},{"line_number":140,"context_line":"    session.VBD \u003d VBD(session)"},{"line_number":141,"context_line":"    session.PBD \u003d PBD(session)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2Bck%3D","line":141,"updated":"2014-01-31 13:57:08.000000000","message":"Should we have VIF as well?\n\nThat would leave network and host missing - they could be added for completeness, but I\u0027m happy for them not to be here.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6904,"name":"Guillaume Thouvenin","email":"gthouvenin@mirantis.com","username":"guillaume-thouvenin"},"change_message_id":"f78cfe24432316683ebab5f4c15e70f883de9c76","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    session.SR \u003d SR(session)"},{"line_number":139,"context_line":"    session.VDI \u003d VDI(session)"},{"line_number":140,"context_line":"    session.VBD \u003d VBD(session)"},{"line_number":141,"context_line":"    session.PBD \u003d PBD(session)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9YQs%3D","line":141,"in_reply_to":"AAAAUH%2F9%2BM4%3D","updated":"2014-02-07 10:33:02.000000000","message":"I also see network.create in vif.py.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"7e976285659b817c2a8662dda9b2f992aad73c41","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    session.SR \u003d SR(session)"},{"line_number":139,"context_line":"    session.VDI \u003d VDI(session)"},{"line_number":140,"context_line":"    session.VBD \u003d VBD(session)"},{"line_number":141,"context_line":"    session.PBD \u003d PBD(session)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BM4%3D","line":141,"in_reply_to":"AAAAUH%2F9%2BRo%3D","updated":"2014-01-31 14:53:29.000000000","message":"vmops.py uses VIF.get_record and VIF.create\nvif.py also uses VLAN and we also use task - but I\u0027m not sure if it\u0027s worth having them all.\n\nEither way I don\u0027t mind that much on this - we can add more as we go I guess.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b9a8bbc2bee643936a55a7a07e661790c432d56","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    session.SR \u003d SR(session)"},{"line_number":139,"context_line":"    session.VDI \u003d VDI(session)"},{"line_number":140,"context_line":"    session.VBD \u003d VBD(session)"},{"line_number":141,"context_line":"    session.PBD \u003d PBD(session)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BRo%3D","line":141,"in_reply_to":"AAAAUH%2F9%2Bck%3D","updated":"2014-01-31 14:29:04.000000000","message":"Not added it because we don\u0027t use it yet.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6904,"name":"Guillaume Thouvenin","email":"gthouvenin@mirantis.com","username":"guillaume-thouvenin"},"change_message_id":"fa60086d87a0b18d3e1d480804721bdd8f0f8473","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"class Host(XenAPISessionObject):"},{"line_number":106,"context_line":"    \"\"\"Physical block device.\"\"\""},{"line_number":107,"context_line":"    def __init__(self, session):"},{"line_number":108,"context_line":"        super(Host, self).__init__(session, \"host\")"},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FlI4%3D","line":106,"updated":"2014-02-12 08:03:47.000000000","message":"Copy/Paste error in the description I think","commit_id":"a7bc6accf6f9f995c93fb777f7eddb8f2403c5b4"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6d2f9c4729b3ae2d049aabab8aae649b267b55e9","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"class Host(XenAPISessionObject):"},{"line_number":106,"context_line":"    \"\"\"Physical block device.\"\"\""},{"line_number":107,"context_line":"    def __init__(self, session):"},{"line_number":108,"context_line":"        super(Host, self).__init__(session, \"host\")"},{"line_number":109,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FeRI%3D","line":106,"in_reply_to":"AAAAUX%2F%2FlI4%3D","updated":"2014-02-12 23:22:49.000000000","message":"oops, thanks.","commit_id":"a7bc6accf6f9f995c93fb777f7eddb8f2403c5b4"},{"author":{"_account_id":6904,"name":"Guillaume Thouvenin","email":"gthouvenin@mirantis.com","username":"guillaume-thouvenin"},"change_message_id":"fa60086d87a0b18d3e1d480804721bdd8f0f8473","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"class Network(XenAPISessionObject):"},{"line_number":112,"context_line":"    \"\"\"Physical block device.\"\"\""},{"line_number":113,"context_line":"    def __init__(self, session):"},{"line_number":114,"context_line":"        super(Network, self).__init__(session, \"network\")"},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FlIw%3D","line":112,"updated":"2014-02-12 08:03:47.000000000","message":"Same copy/paste error","commit_id":"a7bc6accf6f9f995c93fb777f7eddb8f2403c5b4"},{"author":{"_account_id":6904,"name":"Guillaume Thouvenin","email":"gthouvenin@mirantis.com","username":"guillaume-thouvenin"},"change_message_id":"fa60086d87a0b18d3e1d480804721bdd8f0f8473","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"class Pool(XenAPISessionObject):"},{"line_number":118,"context_line":"    \"\"\"Physical block device.\"\"\""},{"line_number":119,"context_line":"    def __init__(self, session):"},{"line_number":120,"context_line":"        super(Pool, self).__init__(session, \"pool\")"},{"line_number":121,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FlIs%3D","line":118,"updated":"2014-02-12 08:03:47.000000000","message":"And here also","commit_id":"a7bc6accf6f9f995c93fb777f7eddb8f2403c5b4"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"67a059eefda186c35febe589fb080991c4f13381","unresolved":false,"context_lines":[{"line_number":128,"context_line":"    session.PBD \u003d PBD(session)"},{"line_number":129,"context_line":"    session.PIF \u003d PIF(session)"},{"line_number":130,"context_line":"    session.VLAN \u003d VLAN(session)"},{"line_number":131,"context_line":"    session.host \u003d Host(session)"},{"line_number":132,"context_line":"    session.network \u003d Network(session)"},{"line_number":133,"context_line":"    session.pool \u003d Pool(session)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Fp6c%3D","line":131,"updated":"2014-02-11 18:10:57.000000000","message":"Not that it matters much, but any reason the capitalization rules changed here, why not `session.Host`?","commit_id":"a7bc6accf6f9f995c93fb777f7eddb8f2403c5b4"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6d2f9c4729b3ae2d049aabab8aae649b267b55e9","unresolved":false,"context_lines":[{"line_number":128,"context_line":"    session.PBD \u003d PBD(session)"},{"line_number":129,"context_line":"    session.PIF \u003d PIF(session)"},{"line_number":130,"context_line":"    session.VLAN \u003d VLAN(session)"},{"line_number":131,"context_line":"    session.host \u003d Host(session)"},{"line_number":132,"context_line":"    session.network \u003d Network(session)"},{"line_number":133,"context_line":"    session.pool \u003d Pool(session)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FeRA%3D","line":131,"in_reply_to":"AAAAUX%2F%2Fp6c%3D","updated":"2014-02-12 23:22:49.000000000","message":"it matches what XenAPI has, I don\u0027t quite understand it myself.","commit_id":"a7bc6accf6f9f995c93fb777f7eddb8f2403c5b4"},{"author":{"_account_id":8430,"name":"Christopher Lefelhocz","email":"christopher.lefelhoc@rackspace.com","username":"leif"},"change_message_id":"13c0af71da536f6c46b6ad74158aa6f8b9765736","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        super(Pool, self).__init__(session, \"pool\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"def apply_session_helpers(session):"},{"line_number":124,"context_line":"    session.VM \u003d VM(session)"},{"line_number":125,"context_line":"    session.SR \u003d SR(session)"},{"line_number":126,"context_line":"    session.VDI \u003d VDI(session)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUX%2F%2FPf8%3D","line":123,"updated":"2014-02-14 15:49:38.000000000","message":"Being overly dense this morning.  Why not include this __init_ for the session?","commit_id":"ecfd1bb84fe4b353cfddfcd89600eade82add188"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2b25c5071c3fda6b0ed5f8545ddc116a488668b5","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        super(Pool, self).__init__(session, \"pool\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"def apply_session_helpers(session):"},{"line_number":124,"context_line":"    session.VM \u003d VM(session)"},{"line_number":125,"context_line":"    session.SR \u003d SR(session)"},{"line_number":126,"context_line":"    session.VDI \u003d VDI(session)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2FzC4%3D","line":123,"in_reply_to":"AAAAU3%2F%2FzWg%3D","updated":"2014-02-24 18:32:16.000000000","message":"Maybe this will sit better as a static method in session that can get call inits init method, and from mocks, that would be better...","commit_id":"ecfd1bb84fe4b353cfddfcd89600eade82add188"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e4b08465d16a44557c06948033594c332048a3f4","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        super(Pool, self).__init__(session, \"pool\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"def apply_session_helpers(session):"},{"line_number":124,"context_line":"    session.VM \u003d VM(session)"},{"line_number":125,"context_line":"    session.SR \u003d SR(session)"},{"line_number":126,"context_line":"    session.VDI \u003d VDI(session)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAU3%2F%2FzWg%3D","line":123,"in_reply_to":"AAAAUX%2F%2FPf8%3D","updated":"2014-02-24 18:09:45.000000000","message":"I want to keep this as the only dependency with this file to all outside code, just seems simpler.\n\nAlso, it means this code can be used multiple places\n* in the actual session object\n* called on any mock object in the tests","commit_id":"ecfd1bb84fe4b353cfddfcd89600eade82add188"},{"author":{"_account_id":100,"name":"Johannes Erdfelt","email":"johannes@erdfelt.com","username":"johannes.erdfelt"},"change_message_id":"057daf84159263676e549bed3eaf8b1cfdad52bc","unresolved":false,"context_lines":[{"line_number":63,"context_line":"class VM(XenAPISessionObject):"},{"line_number":64,"context_line":"    \"\"\"Virtual Machine.\"\"\""},{"line_number":65,"context_line":"    def __init__(self, session):"},{"line_number":66,"context_line":"        super(VM, self).__init__(session, \"VM\")"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"class VBD(XenAPISessionObject):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAVX%2F%2F1nE%3D","line":66,"updated":"2014-02-27 23:07:53.000000000","message":"It would be simpler to just make name be a class attribute for each of these subclasses:\n\n    name \u003d \"VM\"\n\nThen none of them need an __init__","commit_id":"d5a864c1fbb2c9abb25498e95b0f283307f9f000"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"58df6502cb52f8eae0a370f3c7811b7836483ba5","unresolved":false,"context_lines":[{"line_number":63,"context_line":"class VM(XenAPISessionObject):"},{"line_number":64,"context_line":"    \"\"\"Virtual Machine.\"\"\""},{"line_number":65,"context_line":"    def __init__(self, session):"},{"line_number":66,"context_line":"        super(VM, self).__init__(session, \"VM\")"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"class VBD(XenAPISessionObject):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAVX%2F%2Fxnc%3D","line":66,"in_reply_to":"AAAAVX%2F%2F1nE%3D","updated":"2014-02-28 11:21:10.000000000","message":"yeah, thats a good idea.\n\nwill do that if I need another change.","commit_id":"d5a864c1fbb2c9abb25498e95b0f283307f9f000"}],"nova/virt/xenapi/client/session.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"3a27d326e397399e8a758a3656fac7254c07541a","unresolved":false,"context_lines":[{"line_number":292,"context_line":"        call \u003d \"%s.%s\" % (self.name, method_name)"},{"line_number":293,"context_line":"        return self.session.call_xenapi(call, *args)"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    def __getattribute__(self, method_name):"},{"line_number":296,"context_line":"        try:"},{"line_number":297,"context_line":"            return super(XenAPISessionObject, self).__getattribute__(method_name)"},{"line_number":298,"context_line":"        except AttributeError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FY9U%3D","line":295,"updated":"2014-01-14 10:01:40.000000000","message":"Use __getattr__ rather than __getattribute__ so you don\u0027t need the try/except","commit_id":"eb47483f69c305ddfc0c617b6edb213e659cb60c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"3a27d326e397399e8a758a3656fac7254c07541a","unresolved":false,"context_lines":[{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    def __getattribute__(self, method_name):"},{"line_number":296,"context_line":"        try:"},{"line_number":297,"context_line":"            return super(XenAPISessionObject, self).__getattribute__(method_name)"},{"line_number":298,"context_line":"        except AttributeError:"},{"line_number":299,"context_line":"            return lambda *params: self._call_method(method_name, *params)"},{"line_number":300,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FY9M%3D","line":297,"updated":"2014-01-14 10:01:40.000000000","message":"Not needed if using __getattr__?","commit_id":"eb47483f69c305ddfc0c617b6edb213e659cb60c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"3a27d326e397399e8a758a3656fac7254c07541a","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    def __init__(self, session):"},{"line_number":304,"context_line":"        super(VM, self).__init__(session, \"VM\")"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    def create(self, vm_rec):"},{"line_number":307,"context_line":"        #TODO(johngarbutt) - need a better shorthand"},{"line_number":308,"context_line":"        vm_ref \u003d self._call_method(\"create\", vm_rec)"},{"line_number":309,"context_line":"        return vm_ref"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FY8k%3D","line":306,"updated":"2014-01-14 10:01:40.000000000","message":"I really don\u0027t think we should duplicate the API here.  The create method is trivial, therefore doesn\u0027t need to have a wrapper.\n\nWe could expose some of the more common things - such as create, destroy, get_all_records_where in the common base class - which would be a good place for any necessary documentation.\nIt\u0027s true they would still be very thin wrappers, but the documentation would be the main value there.\n\nPerhaps, rather than having a \"create\" method, just link to the API docs from the code.","commit_id":"eb47483f69c305ddfc0c617b6edb213e659cb60c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"3a27d326e397399e8a758a3656fac7254c07541a","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        vm_ref \u003d self._call_method(\"create\", vm_rec)"},{"line_number":309,"context_line":"        return vm_ref"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"def apply_session_helpers(session):"},{"line_number":312,"context_line":"    session.VM \u003d VM(session)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FY8M%3D","line":311,"updated":"2014-01-14 10:01:40.000000000","message":"add_session_helpers?","commit_id":"eb47483f69c305ddfc0c617b6edb213e659cb60c"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"3a27d326e397399e8a758a3656fac7254c07541a","unresolved":false,"context_lines":[{"line_number":309,"context_line":"        return vm_ref"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"def apply_session_helpers(session):"},{"line_number":312,"context_line":"    session.VM \u003d VM(session)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FY8U%3D","line":312,"updated":"2014-01-14 10:01:40.000000000","message":"I think it\u0027d be worth enumerating all of them here or having a __getattr__ on \"session\" that\u0027ll create objects on first access if they don\u0027t already exist.\nIf we want to move to using this style of access for the API then it should work with all classes/methods out of the box IMO.","commit_id":"eb47483f69c305ddfc0c617b6edb213e659cb60c"},{"author":{"_account_id":6904,"name":"Guillaume Thouvenin","email":"gthouvenin@mirantis.com","username":"guillaume-thouvenin"},"change_message_id":"63db60b59b6f23a61e5e2ce91bf4a9b5cac89aca","unresolved":false,"context_lines":[{"line_number":297,"context_line":"            return super(XenAPISessionObject,"},{"line_number":298,"context_line":"                         self).__getattribute__(method_name)"},{"line_number":299,"context_line":"        except AttributeError:"},{"line_number":300,"context_line":"            return lambda *params: self._call_method(method_name, *params)"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"class VM(XenAPISessionObject):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BpsA%3D","line":300,"updated":"2014-01-23 15:17:18.000000000","message":"As bob said __getattr__  seems to fit better here IMHO.\ndef __getattr__(self, method_name):\n    return lambda *params: self._call_method(method_name, *params)","commit_id":"f5cdd945ff59a640b743c52e75d7488cb676c13a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"39ca02448cd5e46a17d16ade84c54435e6f1b342","unresolved":false,"context_lines":[{"line_number":297,"context_line":"            return super(XenAPISessionObject,"},{"line_number":298,"context_line":"                         self).__getattribute__(method_name)"},{"line_number":299,"context_line":"        except AttributeError:"},{"line_number":300,"context_line":"            return lambda *params: self._call_method(method_name, *params)"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"class VM(XenAPISessionObject):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BSw0%3D","line":300,"in_reply_to":"AAAAUH%2F%2BpsA%3D","updated":"2014-01-28 10:27:52.000000000","message":"yeah, let me try that out, now I have this working.","commit_id":"f5cdd945ff59a640b743c52e75d7488cb676c13a"},{"author":{"_account_id":3217,"name":"Ian Wells","username":"ijw-ubuntu"},"change_message_id":"b53a29e97a99f0d788ca0805ea3d51bd6b3c0c9c","unresolved":false,"context_lines":[{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    def create(self, vm_rec):"},{"line_number":308,"context_line":"        #TODO(johngarbutt) this should be easier, although its not needed"},{"line_number":309,"context_line":"        vm_ref \u003d self._call_method(\"create\", vm_rec)"},{"line_number":310,"context_line":"        return vm_ref"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BvmM%3D","line":309,"updated":"2014-01-22 15:40:44.000000000","message":"Seems like these functions will all be repetitive and prone to C\u0026P errors.  Perhaps you can discover and use the method name rather than \u0027create\u0027 in this call?","commit_id":"f5cdd945ff59a640b743c52e75d7488cb676c13a"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"eeae2442fc62729da101514115de527925384c7f","unresolved":false,"context_lines":[{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    def create(self, vm_rec):"},{"line_number":308,"context_line":"        #TODO(johngarbutt) this should be easier, although its not needed"},{"line_number":309,"context_line":"        vm_ref \u003d self._call_method(\"create\", vm_rec)"},{"line_number":310,"context_line":"        return vm_ref"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BjJg%3D","line":309,"in_reply_to":"AAAAUH%2F%2BvmM%3D","updated":"2014-01-24 14:17:51.000000000","message":"John would like to add these for IDE discovery of the methods to aid auto complete.","commit_id":"f5cdd945ff59a640b743c52e75d7488cb676c13a"},{"author":{"_account_id":6904,"name":"Guillaume Thouvenin","email":"gthouvenin@mirantis.com","username":"guillaume-thouvenin"},"change_message_id":"63db60b59b6f23a61e5e2ce91bf4a9b5cac89aca","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        #TODO(johngarbutt) this should be easier, although its not needed"},{"line_number":309,"context_line":"        vm_ref \u003d self._call_method(\"create\", vm_rec)"},{"line_number":310,"context_line":"        return vm_ref"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"def apply_session_helpers(session):"},{"line_number":314,"context_line":"    session.VM \u003d VM(session)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2Bplc%3D","line":311,"updated":"2014-01-23 15:17:18.000000000","message":"Why don\u0027t  just keep the __init__ method in the class VM and add documentation in XenAPISessionObject to document the API ?","commit_id":"f5cdd945ff59a640b743c52e75d7488cb676c13a"},{"author":{"_account_id":6904,"name":"Guillaume Thouvenin","email":"gthouvenin@mirantis.com","username":"guillaume-thouvenin"},"change_message_id":"c7f632eca7af88002468cd9015d3a6b5e697915b","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        #TODO(johngarbutt) this should be easier, although its not needed"},{"line_number":309,"context_line":"        vm_ref \u003d self._call_method(\"create\", vm_rec)"},{"line_number":310,"context_line":"        return vm_ref"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"def apply_session_helpers(session):"},{"line_number":314,"context_line":"    session.VM \u003d VM(session)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BRjY%3D","line":311,"in_reply_to":"AAAAUH%2F%2BSxE%3D","updated":"2014-01-28 14:03:04.000000000","message":"Yes right I always forget unit test. IIUC if you create an VM instance, a call to a method will be automatically converted into a session.call_xenapi(\"VM.method_name\", *args). So in fact everything is working \"magically\" and added a method like \"create\" seems unnecessary. So that\u0027s why I asked if all methods can be replaced by documentation. But as you said I miss the point that documentation is not so easy to maintain and to unit test :) And the other point I missed is that it is useful for IDE and autocompletion.","commit_id":"f5cdd945ff59a640b743c52e75d7488cb676c13a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"39ca02448cd5e46a17d16ade84c54435e6f1b342","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        #TODO(johngarbutt) this should be easier, although its not needed"},{"line_number":309,"context_line":"        vm_ref \u003d self._call_method(\"create\", vm_rec)"},{"line_number":310,"context_line":"        return vm_ref"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":""},{"line_number":313,"context_line":"def apply_session_helpers(session):"},{"line_number":314,"context_line":"    session.VM \u003d VM(session)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BSxE%3D","line":311,"in_reply_to":"AAAAUH%2F%2Bplc%3D","updated":"2014-01-28 10:27:52.000000000","message":"documentation is not as easy to keep in sync as real code thats unit tested and used.\n\nThere are going to be sub classes for VDI, etc, etc, not sure I get you.","commit_id":"f5cdd945ff59a640b743c52e75d7488cb676c13a"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"af5b66bf24a44116aeaeea1f217f4df19730d1b0","unresolved":false,"context_lines":[{"line_number":53,"context_line":"CONF.import_opt(\u0027host\u0027, \u0027nova.netconf\u0027)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"def apply_session_helpers(session):"},{"line_number":57,"context_line":"    session.VM \u003d objects.VM(session)"},{"line_number":58,"context_line":"    session.SR \u003d objects.SR(session)"},{"line_number":59,"context_line":"    session.VDI \u003d objects.VDI(session)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVX%2F%2F5Gk%3D","line":56,"updated":"2014-02-27 15:10:01.000000000","message":"This really wants to be an instance method on XenAPISession because it\u0027s operating on an instance of the class.","commit_id":"acd00a885b30d7107c02ee2c9019197a2fdd87e5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0bbd84ce00a4dfd9c2e2339a75479c1363db0be9","unresolved":false,"context_lines":[{"line_number":53,"context_line":"CONF.import_opt(\u0027host\u0027, \u0027nova.netconf\u0027)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"def apply_session_helpers(session):"},{"line_number":57,"context_line":"    session.VM \u003d objects.VM(session)"},{"line_number":58,"context_line":"    session.SR \u003d objects.SR(session)"},{"line_number":59,"context_line":"    session.VDI \u003d objects.VDI(session)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVX%2F%2F4%2F4%3D","line":56,"in_reply_to":"AAAAVX%2F%2F5Gk%3D","updated":"2014-02-27 15:15:14.000000000","message":"I agree, but see below.","commit_id":"acd00a885b30d7107c02ee2c9019197a2fdd87e5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0bbd84ce00a4dfd9c2e2339a75479c1363db0be9","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    # MINOR VERSION: Compatible changes, new plguins, etc"},{"line_number":76,"context_line":"    PLUGIN_REQUIRED_VERSION \u003d \u00271.1\u0027"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def __init__(self, url, user, pw):"},{"line_number":79,"context_line":"        import XenAPI"},{"line_number":80,"context_line":"        self.XenAPI \u003d XenAPI"},{"line_number":81,"context_line":"        self._sessions \u003d queue.Queue()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVX%2F%2F4%2FM%3D","line":78,"updated":"2014-02-27 15:15:14.000000000","message":"The fake stuff is mostly trying to avoid this line.\n\nWe should have a better way of doing that though.","commit_id":"acd00a885b30d7107c02ee2c9019197a2fdd87e5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"58df6502cb52f8eae0a370f3c7811b7836483ba5","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        self._verify_plugin_version()"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        apply_session_helpers(self)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def _verify_plugin_version(self):"},{"line_number":97,"context_line":"        requested_version \u003d self.PLUGIN_REQUIRED_VERSION"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAVX%2F%2FxnU%3D","line":94,"updated":"2014-02-28 11:21:10.000000000","message":"we can do better than this, but lets get this in, then tidy this up? please?","commit_id":"d5a864c1fbb2c9abb25498e95b0f283307f9f000"}],"nova/virt/xenapi/vm_utils.py":[{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"14f39dbedacde4fc656bb5689e86f6b8c6e6f546","unresolved":false,"context_lines":[{"line_number":1925,"context_line":"        LOG.debug(_(\"ISO: SR MATCHing our criteria\"))"},{"line_number":1926,"context_line":"        for pbd_ref in sr_rec[\u0027PBDs\u0027]:"},{"line_number":1927,"context_line":"            LOG.debug(_(\"ISO: ISO, looking to see if it is host local\"))"},{"line_number":1928,"context_line":"            pbd_rec \u003d session.PBD.get_record_safe(pbd_ref)"},{"line_number":1929,"context_line":"            if not pbd_rec:"},{"line_number":1930,"context_line":"                LOG.debug(_(\"ISO: PBD %s disappeared\"), pbd_ref)"},{"line_number":1931,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BZ4%3D","line":1928,"updated":"2014-01-31 13:57:08.000000000","message":"I think we should just replace \"get_record\" in the common class to invoke the safer behaviour.\n\nBecause no one is currently using session.XYZ.get_record we can safely fix this behaviour now without adding \"get_record_safe\"","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"7e976285659b817c2a8662dda9b2f992aad73c41","unresolved":false,"context_lines":[{"line_number":1925,"context_line":"        LOG.debug(_(\"ISO: SR MATCHing our criteria\"))"},{"line_number":1926,"context_line":"        for pbd_ref in sr_rec[\u0027PBDs\u0027]:"},{"line_number":1927,"context_line":"            LOG.debug(_(\"ISO: ISO, looking to see if it is host local\"))"},{"line_number":1928,"context_line":"            pbd_rec \u003d session.PBD.get_record_safe(pbd_ref)"},{"line_number":1929,"context_line":"            if not pbd_rec:"},{"line_number":1930,"context_line":"                LOG.debug(_(\"ISO: PBD %s disappeared\"), pbd_ref)"},{"line_number":1931,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BJ0%3D","line":1928,"in_reply_to":"AAAAUH%2F9%2BRI%3D","updated":"2014-01-31 14:53:29.000000000","message":"But none of the other calls are using this new object-style syntax for getting the record.\nIf we want people to use get_record_safe, perhaps add a get_record to the base class which throws an error telling them to use get_record_safe when they move to the new syntax.","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9b9a8bbc2bee643936a55a7a07e661790c432d56","unresolved":false,"context_lines":[{"line_number":1925,"context_line":"        LOG.debug(_(\"ISO: SR MATCHing our criteria\"))"},{"line_number":1926,"context_line":"        for pbd_ref in sr_rec[\u0027PBDs\u0027]:"},{"line_number":1927,"context_line":"            LOG.debug(_(\"ISO: ISO, looking to see if it is host local\"))"},{"line_number":1928,"context_line":"            pbd_rec \u003d session.PBD.get_record_safe(pbd_ref)"},{"line_number":1929,"context_line":"            if not pbd_rec:"},{"line_number":1930,"context_line":"                LOG.debug(_(\"ISO: PBD %s disappeared\"), pbd_ref)"},{"line_number":1931,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F9%2BRI%3D","line":1928,"in_reply_to":"AAAAUH%2F9%2BZ4%3D","updated":"2014-01-31 14:29:04.000000000","message":"I don\u0027t want to do that, because most other calls to get_record are relaying on the XenAPI exception being thrown if the record is not present :(","commit_id":"b84009a32a0c21ce5f39893f5745df6147c1d35b"}]}
