)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":11,"context_line":"openstack instance. Modifying the resize workflow"},{"line_number":12,"context_line":"to use the above mentioned methods"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I92acdd5cd00f739d504738413d3b63a2e17f2866"},{"line_number":15,"context_line":"Closes-Bug: #1295381"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAAWH%2F%2B2Qc%3D","line":14,"updated":"2014-03-23 08:28:21.000000000","message":"This also successfully addressed - https://launchpad.net/bugs/1290807","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Sidharth Surana \u003cssurana@vmware.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-03-24 16:18:32 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fixes the instance resize problem"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The fix includes seperating out methods for"},{"line_number":10,"context_line":"associating/disassociating a vsphere vm from the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAWH%2F%2Bs%2Fw%3D","line":7,"updated":"2014-03-24 23:53:03.000000000","message":"I\u0027ve been told before to prefix vmware patches with \"VMware: \"","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Sidharth Surana \u003cssurana@vmware.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-03-24 16:18:32 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fixes the instance resize problem"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The fix includes seperating out methods for"},{"line_number":10,"context_line":"associating/disassociating a vsphere vm from the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAWH%2F%2BsrQ%3D","line":7,"in_reply_to":"AAAAWH%2F%2Bs%2Fw%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"fdf1a916da7bb2238b082598f04571e6bc81df9d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"VMware: Fixes the instance resize problem"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The fix includes seperating out methods for"},{"line_number":10,"context_line":"associating/disassociating a vsphere vm from the"},{"line_number":11,"context_line":"openstack instance. Modifying the resize workflow"},{"line_number":12,"context_line":"to use the above mentioned methods"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"AAAAWH%2F%2BjRA%3D","line":9,"updated":"2014-03-26 00:14:07.000000000","message":"Typo: seperating -\u003e separating","commit_id":"74af72a8a3852398f83f3c7e50f5269628213086"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"54bb252b41219402b6893a376c6c867897692bb9","unresolved":false,"context_lines":[{"line_number":9,"context_line":"The fix includes separating out methods for"},{"line_number":10,"context_line":"associating/disassociating a vsphere vm from the"},{"line_number":11,"context_line":"openstack instance. Modifying the resize workflow"},{"line_number":12,"context_line":"to use the above mentioned methods"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I92acdd5cd00f739d504738413d3b63a2e17f2866"},{"line_number":15,"context_line":"Closes-Bug: #1295381"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"AAAAWH%2F%2BQqk%3D","line":12,"updated":"2014-03-28 01:56:11.000000000","message":"Nit: methods -\u003e methods.","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"f2813f603c6b233e6cf4603dd7cab96a95a19d2b","unresolved":false,"context_lines":[{"line_number":9,"context_line":"The fix includes separating out methods for"},{"line_number":10,"context_line":"associating/disassociating a vsphere vm from the"},{"line_number":11,"context_line":"openstack instance. Modifying the resize workflow"},{"line_number":12,"context_line":"to use the above mentioned methods"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I92acdd5cd00f739d504738413d3b63a2e17f2866"},{"line_number":15,"context_line":"Closes-Bug: #1295381"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"AAAAWH%2F%2BQmM%3D","line":12,"in_reply_to":"AAAAWH%2F%2BQqk%3D","updated":"2014-03-28 02:06:39.000000000","message":"Done","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"}],"nova/virt/vmwareapi/fake.py":[{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        if hasattr(val, \u0027extraConfig\u0027) and val.extraConfig:"},{"line_number":448,"context_line":"            extraConfigs \u003d self.get(\"config.extraConfig\").OptionValue"},{"line_number":449,"context_line":"            if not extraConfigs:"},{"line_number":450,"context_line":"                extraConfigs \u003d []"},{"line_number":451,"context_line":"            # Merge existing extraConfig with the one in config"},{"line_number":452,"context_line":"            for c in val.extraConfig:"},{"line_number":453,"context_line":"                if len([x for x in extraConfigs if x.key \u003d\u003d c.key]) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs58%3D","line":450,"updated":"2014-03-24 23:53:03.000000000","message":"You can also simply do:\nextraConfigs \u003d self.get(\"config.extraConfig\").OptionValue or []","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        if hasattr(val, \u0027extraConfig\u0027) and val.extraConfig:"},{"line_number":448,"context_line":"            extraConfigs \u003d self.get(\"config.extraConfig\").OptionValue"},{"line_number":449,"context_line":"            if not extraConfigs:"},{"line_number":450,"context_line":"                extraConfigs \u003d []"},{"line_number":451,"context_line":"            # Merge existing extraConfig with the one in config"},{"line_number":452,"context_line":"            for c in val.extraConfig:"},{"line_number":453,"context_line":"                if len([x for x in extraConfigs if x.key \u003d\u003d c.key]) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2BstA%3D","line":450,"in_reply_to":"AAAAWH%2F%2Bs58%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":1174,"context_line":""},{"line_number":1175,"context_line":"        if clone_spec.config is not None:"},{"line_number":1176,"context_line":"            # Impose the config changes specified in the config property"},{"line_number":1177,"context_line":"            if hasattr(clone_spec.config, \u0027instanceUuid\u0027) and \\"},{"line_number":1178,"context_line":"               clone_spec.config.instanceUuid is not None:"},{"line_number":1179,"context_line":"                vm_dict[\"instanceUuid\"] \u003d clone_spec.config.instanceUuid"},{"line_number":1180,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs4g%3D","line":1177,"updated":"2014-03-24 23:53:03.000000000","message":"Long lines should be wrapped in parentheses in preference to using a backslash for line continuation.\n\nhttp://docs.openstack.org/developer/hacking/","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":1174,"context_line":""},{"line_number":1175,"context_line":"        if clone_spec.config is not None:"},{"line_number":1176,"context_line":"            # Impose the config changes specified in the config property"},{"line_number":1177,"context_line":"            if hasattr(clone_spec.config, \u0027instanceUuid\u0027) and \\"},{"line_number":1178,"context_line":"               clone_spec.config.instanceUuid is not None:"},{"line_number":1179,"context_line":"                vm_dict[\"instanceUuid\"] \u003d clone_spec.config.instanceUuid"},{"line_number":1180,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bss8%3D","line":1177,"in_reply_to":"AAAAWH%2F%2Bs4g%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":1178,"context_line":"               clone_spec.config.instanceUuid is not None:"},{"line_number":1179,"context_line":"                vm_dict[\"instanceUuid\"] \u003d clone_spec.config.instanceUuid"},{"line_number":1180,"context_line":""},{"line_number":1181,"context_line":"            if hasattr(clone_spec.config, \u0027extraConfig\u0027) and \\"},{"line_number":1182,"context_line":"               clone_spec.config.extraConfig:"},{"line_number":1183,"context_line":"                extraConfigs \u003d vm_dict[\"extra_config\"]"},{"line_number":1184,"context_line":"                if not extraConfigs:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs4c%3D","line":1181,"updated":"2014-03-24 23:53:03.000000000","message":"Long lines should be wrapped in parentheses in preference to using a backslash for line continuation.\n\nhttp://docs.openstack.org/developer/hacking/","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":1178,"context_line":"               clone_spec.config.instanceUuid is not None:"},{"line_number":1179,"context_line":"                vm_dict[\"instanceUuid\"] \u003d clone_spec.config.instanceUuid"},{"line_number":1180,"context_line":""},{"line_number":1181,"context_line":"            if hasattr(clone_spec.config, \u0027extraConfig\u0027) and \\"},{"line_number":1182,"context_line":"               clone_spec.config.extraConfig:"},{"line_number":1183,"context_line":"                extraConfigs \u003d vm_dict[\"extra_config\"]"},{"line_number":1184,"context_line":"                if not extraConfigs:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bss4%3D","line":1181,"in_reply_to":"AAAAWH%2F%2Bs4c%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":1182,"context_line":"               clone_spec.config.extraConfig:"},{"line_number":1183,"context_line":"                extraConfigs \u003d vm_dict[\"extra_config\"]"},{"line_number":1184,"context_line":"                if not extraConfigs:"},{"line_number":1185,"context_line":"                    extraConfigs \u003d []"},{"line_number":1186,"context_line":"                # Merge existing extraConfig with the one in config"},{"line_number":1187,"context_line":"                for c in clone_spec.config.extraConfig:"},{"line_number":1188,"context_line":"                    if len([x for x in extraConfigs if x.key \u003d\u003d c.key]) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs4Y%3D","line":1185,"updated":"2014-03-24 23:53:03.000000000","message":"extraConfigs \u003d vm_dict[\"extra_config\"] or []","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":1182,"context_line":"               clone_spec.config.extraConfig:"},{"line_number":1183,"context_line":"                extraConfigs \u003d vm_dict[\"extra_config\"]"},{"line_number":1184,"context_line":"                if not extraConfigs:"},{"line_number":1185,"context_line":"                    extraConfigs \u003d []"},{"line_number":1186,"context_line":"                # Merge existing extraConfig with the one in config"},{"line_number":1187,"context_line":"                for c in clone_spec.config.extraConfig:"},{"line_number":1188,"context_line":"                    if len([x for x in extraConfigs if x.key \u003d\u003d c.key]) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bss0%3D","line":1185,"in_reply_to":"AAAAWH%2F%2Bs4Y%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"38076525759369114d7af2908bb70ec0d660bce2","unresolved":false,"context_lines":[{"line_number":1184,"context_line":"               clone_spec.config.instanceUuid is not None):"},{"line_number":1185,"context_line":"                vm_dict[\"instanceUuid\"] \u003d clone_spec.config.instanceUuid"},{"line_number":1186,"context_line":""},{"line_number":1187,"context_line":"            if (hasattr(clone_spec.config, \u0027extraConfig\u0027) and"},{"line_number":1188,"context_line":"               clone_spec.config.extraConfig):"},{"line_number":1189,"context_line":"                extraConfigs \u003d vm_dict[\"extra_config\"] or []"},{"line_number":1190,"context_line":"                # Merge existing extraConfig with the one in config"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2BW14%3D","line":1187,"updated":"2014-03-27 12:52:30.000000000","message":"this looks like duplicate code with lines 447-456\n\ncould you extract a method for this merge?","commit_id":"166261146ab3caeb7b0b95c7ecd14a001edfd263"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"9a491e46fe0b20ac721aa41eeb819bed8feeed82","unresolved":false,"context_lines":[{"line_number":1184,"context_line":"               clone_spec.config.instanceUuid is not None):"},{"line_number":1185,"context_line":"                vm_dict[\"instanceUuid\"] \u003d clone_spec.config.instanceUuid"},{"line_number":1186,"context_line":""},{"line_number":1187,"context_line":"            if (hasattr(clone_spec.config, \u0027extraConfig\u0027) and"},{"line_number":1188,"context_line":"               clone_spec.config.extraConfig):"},{"line_number":1189,"context_line":"                extraConfigs \u003d vm_dict[\"extra_config\"] or []"},{"line_number":1190,"context_line":"                # Merge existing extraConfig with the one in config"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAWH%2F%2BSbE%3D","line":1187,"in_reply_to":"AAAAWH%2F%2BW14%3D","updated":"2014-03-27 20:36:10.000000000","message":"Done","commit_id":"166261146ab3caeb7b0b95c7ecd14a001edfd263"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"54bb252b41219402b6893a376c6c867897692bb9","unresolved":false,"context_lines":[{"line_number":976,"context_line":"def _merge_extraconfig(existing, changes):"},{"line_number":977,"context_line":"    \"\"\"Imposes the changes in extraConfig over the existing extraConfig.\"\"\""},{"line_number":978,"context_line":"    if existing is None:"},{"line_number":979,"context_line":"        existing \u003d []"},{"line_number":980,"context_line":"    if (changes):"},{"line_number":981,"context_line":"        for c in changes:"},{"line_number":982,"context_line":"            if len([x for x in existing if x.key \u003d\u003d c.key]) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQrg%3D","line":979,"updated":"2014-03-28 01:56:11.000000000","message":"existing \u003d existing or []","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"f2813f603c6b233e6cf4603dd7cab96a95a19d2b","unresolved":false,"context_lines":[{"line_number":976,"context_line":"def _merge_extraconfig(existing, changes):"},{"line_number":977,"context_line":"    \"\"\"Imposes the changes in extraConfig over the existing extraConfig.\"\"\""},{"line_number":978,"context_line":"    if existing is None:"},{"line_number":979,"context_line":"        existing \u003d []"},{"line_number":980,"context_line":"    if (changes):"},{"line_number":981,"context_line":"        for c in changes:"},{"line_number":982,"context_line":"            if len([x for x in existing if x.key \u003d\u003d c.key]) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQmA%3D","line":979,"in_reply_to":"AAAAWH%2F%2BQrg%3D","updated":"2014-03-28 02:06:39.000000000","message":"Done","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"013b6d49bdbb173091749602828458309c35a21d","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"        ds \u003d _db_content[\"Datastore\"].keys()[0]"},{"line_number":1177,"context_line":"        host \u003d _db_content[\"HostSystem\"].keys()[0]"},{"line_number":1178,"context_line":"        vm_dict \u003d {"},{"line_number":1179,"context_line":"         \"name\": kwargs.get(\"name\"),"},{"line_number":1180,"context_line":"         \"ds\": source_vm_mdo.get(\"datastore\"),"},{"line_number":1181,"context_line":"         \"runtime_host\": source_vm_mdo.get(\"runtime.host\"),"},{"line_number":1182,"context_line":"         \"powerstate\": source_vm_mdo.get(\"runtime.powerState\"),"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAWH%2F%2BNjg%3D","line":1179,"updated":"2014-03-28 11:40:27.000000000","message":"Seems a shame not to share code with create_vm here. Seems very complex for a fake. But its a minor nit really, given this bug is so important.","commit_id":"44fa75313c870f6c79e10e5395bdaef0de9057e1"}],"nova/virt/vmwareapi/vm_util.py":[{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"2bbb6346942bf78d878fbcebe35f6752374e4e3a","unresolved":false,"context_lines":[{"line_number":577,"context_line":"    clone_spec.powerOn \u003d power_on"},{"line_number":578,"context_line":"    if snapshot:"},{"line_number":579,"context_line":"        clone_spec.snapshot \u003d snapshot"},{"line_number":580,"context_line":"    if config:"},{"line_number":581,"context_line":"        clone_spec.config \u003d config"},{"line_number":582,"context_line":"    clone_spec.template \u003d template"},{"line_number":583,"context_line":"    return clone_spec"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B3dg%3D","line":580,"updated":"2014-03-22 11:51:46.000000000","message":"I write this a lot myself and pretty consistently get a comment to use \"is not None\" in this context I don\u0027t think it matters... But there you have it.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":577,"context_line":"    clone_spec.powerOn \u003d power_on"},{"line_number":578,"context_line":"    if snapshot:"},{"line_number":579,"context_line":"        clone_spec.snapshot \u003d snapshot"},{"line_number":580,"context_line":"    if config:"},{"line_number":581,"context_line":"        clone_spec.config \u003d config"},{"line_number":582,"context_line":"    clone_spec.template \u003d template"},{"line_number":583,"context_line":"    return clone_spec"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2ZQ%3D","line":580,"in_reply_to":"AAAAWH%2F%2B3dg%3D","updated":"2014-03-24 00:54:25.000000000","message":"Done","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"2bbb6346942bf78d878fbcebe35f6752374e4e3a","unresolved":false,"context_lines":[{"line_number":836,"context_line":"    return vm_ref"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"def get_vm_ref_by_uuid(session, uuid):"},{"line_number":840,"context_line":"    \"\"\"Get reference to the VM through uuid.\"\"\""},{"line_number":841,"context_line":"    vm_ref \u003d (_get_vm_ref_from_vm_uuid(session, uuid) or"},{"line_number":842,"context_line":"                  _get_vm_ref_from_extraconfig(session, uuid) or"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B3dU%3D","line":839,"updated":"2014-03-22 11:51:46.000000000","message":"I don\u0027t want to expose this detail. Part of what I am trying to do is constrain the number of ways to find a vm_ref... I am doing this for potential changes in the future involving objects such as a VirtualMachine object which can hide details we want to change.\n\n\nMake this method private.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":836,"context_line":"    return vm_ref"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"def get_vm_ref_by_uuid(session, uuid):"},{"line_number":840,"context_line":"    \"\"\"Get reference to the VM through uuid.\"\"\""},{"line_number":841,"context_line":"    vm_ref \u003d (_get_vm_ref_from_vm_uuid(session, uuid) or"},{"line_number":842,"context_line":"                  _get_vm_ref_from_extraconfig(session, uuid) or"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2ZM%3D","line":839,"in_reply_to":"AAAAWH%2F%2B3dU%3D","updated":"2014-03-24 00:54:25.000000000","message":"I think since I have to use this method in the vmops.py as well, thus keeping it not private is a better approach. However, to ensure proper usage of this method, I have tried to add relevant comment for the method so as to specify its use. Hopefully, this is an acceptable middle ground","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":836,"context_line":"    return vm_ref"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"def get_vm_ref_by_uuid(session, uuid):"},{"line_number":840,"context_line":"    \"\"\"Get reference to the VM through uuid.\"\"\""},{"line_number":841,"context_line":"    vm_ref \u003d (_get_vm_ref_from_vm_uuid(session, uuid) or"},{"line_number":842,"context_line":"                  _get_vm_ref_from_extraconfig(session, uuid) or"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2RE%3D","line":839,"in_reply_to":"AAAAWH%2F%2B3dU%3D","updated":"2014-03-23 08:28:21.000000000","message":"This used used externally. I do not think that it can be a private method here","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1371,"context_line":"    clone_spec \u003d clone_vm_spec(client_factory, rel_spec, config\u003dreconfig_spec)"},{"line_number":1372,"context_line":""},{"line_number":1373,"context_line":"    # Clone VM on ESX host"},{"line_number":1374,"context_line":"    LOG.debug(_(\"Cloning VM for instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1375,"context_line":"               instance\u003dinstance)"},{"line_number":1376,"context_line":"    vm_clone_task \u003d session._call_method("},{"line_number":1377,"context_line":"                            session._get_vim(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2RQ%3D","line":1374,"updated":"2014-03-23 08:28:21.000000000","message":"please use a , instead of %","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1371,"context_line":"    clone_spec \u003d clone_vm_spec(client_factory, rel_spec, config\u003dreconfig_spec)"},{"line_number":1372,"context_line":""},{"line_number":1373,"context_line":"    # Clone VM on ESX host"},{"line_number":1374,"context_line":"    LOG.debug(_(\"Cloning VM for instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1375,"context_line":"               instance\u003dinstance)"},{"line_number":1376,"context_line":"    vm_clone_task \u003d session._call_method("},{"line_number":1377,"context_line":"                            session._get_vim(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B0yE%3D","line":1374,"in_reply_to":"AAAAWH%2F%2B2RQ%3D","updated":"2014-03-24 00:54:25.000000000","message":"Done","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1379,"context_line":"                            folder\u003dvmfolder_ref,"},{"line_number":1380,"context_line":"                            name\u003dinstance[\u0027uuid\u0027],"},{"line_number":1381,"context_line":"                            spec\u003dclone_spec)"},{"line_number":1382,"context_line":"    session._wait_for_task(vm_clone_task)"},{"line_number":1383,"context_line":"    LOG.debug(_(\"Cloned VM for instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1384,"context_line":"               instance\u003dinstance)"},{"line_number":1385,"context_line":"    # Invalidate the cache, so that it is refetched the next time"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2RA%3D","line":1382,"updated":"2014-03-23 08:28:21.000000000","message":"The task returns the moref for the VM so we could update the cache from this.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1379,"context_line":"                            folder\u003dvmfolder_ref,"},{"line_number":1380,"context_line":"                            name\u003dinstance[\u0027uuid\u0027],"},{"line_number":1381,"context_line":"                            spec\u003dclone_spec)"},{"line_number":1382,"context_line":"    session._wait_for_task(vm_clone_task)"},{"line_number":1383,"context_line":"    LOG.debug(_(\"Cloned VM for instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1384,"context_line":"               instance\u003dinstance)"},{"line_number":1385,"context_line":"    # Invalidate the cache, so that it is refetched the next time"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B0y4%3D","line":1382,"in_reply_to":"AAAAWH%2F%2B2RA%3D","updated":"2014-03-24 00:54:25.000000000","message":"Yes, we potentially could do that. However, I think for any given cache, we population of value should occur only when there is a request it cannot fulfill and thus goes to the actual function that it is caching to compute the value. I prefer that we never add any value to the cache directly without going though the function it is caching. \nPlease comment if you feel strongly about updating the cache here directly.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1380,"context_line":"                            name\u003dinstance[\u0027uuid\u0027],"},{"line_number":1381,"context_line":"                            spec\u003dclone_spec)"},{"line_number":1382,"context_line":"    session._wait_for_task(vm_clone_task)"},{"line_number":1383,"context_line":"    LOG.debug(_(\"Cloned VM for instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1384,"context_line":"               instance\u003dinstance)"},{"line_number":1385,"context_line":"    # Invalidate the cache, so that it is refetched the next time"},{"line_number":1386,"context_line":"    vm_ref_cache_delete(instance[\u0027uuid\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2Q8%3D","line":1383,"updated":"2014-03-23 08:28:21.000000000","message":"please use , instead of the %","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1380,"context_line":"                            name\u003dinstance[\u0027uuid\u0027],"},{"line_number":1381,"context_line":"                            spec\u003dclone_spec)"},{"line_number":1382,"context_line":"    session._wait_for_task(vm_clone_task)"},{"line_number":1383,"context_line":"    LOG.debug(_(\"Cloned VM for instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1384,"context_line":"               instance\u003dinstance)"},{"line_number":1385,"context_line":"    # Invalidate the cache, so that it is refetched the next time"},{"line_number":1386,"context_line":"    vm_ref_cache_delete(instance[\u0027uuid\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B0x8%3D","line":1383,"in_reply_to":"AAAAWH%2F%2B2Q8%3D","updated":"2014-03-24 00:54:25.000000000","message":"Done","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"2bbb6346942bf78d878fbcebe35f6752374e4e3a","unresolved":false,"context_lines":[{"line_number":1383,"context_line":"    LOG.debug(_(\"Cloned VM for instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1384,"context_line":"               instance\u003dinstance)"},{"line_number":1385,"context_line":"    # Invalidate the cache, so that it is refetched the next time"},{"line_number":1386,"context_line":"    vm_ref_cache_delete(instance[\u0027uuid\u0027])"},{"line_number":1387,"context_line":""},{"line_number":1388,"context_line":""},{"line_number":1389,"context_line":"def disassociate_vmref_from_instance(session, instance, vm_ref\u003dNone,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B3dM%3D","line":1386,"updated":"2014-03-22 11:51:46.000000000","message":"use the decorator for invalidate at the top of this method... or the flush.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1402,"context_line":"                        client_factory, extra_opts)"},{"line_number":1403,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"},{"line_number":1404,"context_line":"    reconfig_spec.instanceUuid \u003d \u0027\u0027"},{"line_number":1405,"context_line":"    LOG.debug(_(\"Disassociating VM from instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1406,"context_line":"               instance\u003dinstance)"},{"line_number":1407,"context_line":"    reconfig_task \u003d session._call_method("},{"line_number":1408,"context_line":"                                        session._get_vim(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2RM%3D","line":1405,"updated":"2014-03-23 08:28:21.000000000","message":"please use a , instead of %","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1402,"context_line":"                        client_factory, extra_opts)"},{"line_number":1403,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"},{"line_number":1404,"context_line":"    reconfig_spec.instanceUuid \u003d \u0027\u0027"},{"line_number":1405,"context_line":"    LOG.debug(_(\"Disassociating VM from instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1406,"context_line":"               instance\u003dinstance)"},{"line_number":1407,"context_line":"    reconfig_task \u003d session._call_method("},{"line_number":1408,"context_line":"                                        session._get_vim(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B0x0%3D","line":1405,"in_reply_to":"AAAAWH%2F%2B2RM%3D","updated":"2014-03-24 00:54:25.000000000","message":"Done","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1408,"context_line":"                                        session._get_vim(),"},{"line_number":1409,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1410,"context_line":"                                        spec\u003dreconfig_spec)"},{"line_number":1411,"context_line":"    session._wait_for_task(reconfig_task)"},{"line_number":1412,"context_line":"    LOG.debug(_(\"Disassociated VM from instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1413,"context_line":"               instance\u003dinstance)"},{"line_number":1414,"context_line":"    # Invalidate the cache, so that it is refetched the next time"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2Qw%3D","line":1411,"updated":"2014-03-23 08:28:21.000000000","message":"task returns the moref of the VM","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1410,"context_line":"                                        spec\u003dreconfig_spec)"},{"line_number":1411,"context_line":"    session._wait_for_task(reconfig_task)"},{"line_number":1412,"context_line":"    LOG.debug(_(\"Disassociated VM from instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1413,"context_line":"               instance\u003dinstance)"},{"line_number":1414,"context_line":"    # Invalidate the cache, so that it is refetched the next time"},{"line_number":1415,"context_line":"    vm_ref_cache_delete(instance[\u0027uuid\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2RI%3D","line":1412,"updated":"2014-03-23 08:28:21.000000000","message":"ditto","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"2bbb6346942bf78d878fbcebe35f6752374e4e3a","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"    3. Reset the instanceUUID of the VM to be instance[uuid]"},{"line_number":1425,"context_line":"    \"\"\""},{"line_number":1426,"context_line":"    if vm_ref is None:"},{"line_number":1427,"context_line":"        vm_ref \u003d get_vm_ref_by_uuid(session, instance[\u0027uuid\u0027] + suffix)"},{"line_number":1428,"context_line":"    if vm_ref is None:"},{"line_number":1429,"context_line":"        raise exception.InstanceNotFound(instance_id\u003dinstance[\u0027uuid\u0027] + suffix)"},{"line_number":1430,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B3cQ%3D","line":1427,"updated":"2014-03-22 11:51:46.000000000","message":"Now I see your problem. I think this should be a special case so we should hide the method get_vm_ref_by_uuid just to be sure use of it doesn\u0027t spread. We should also document that.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"    3. Reset the instanceUUID of the VM to be instance[uuid]"},{"line_number":1425,"context_line":"    \"\"\""},{"line_number":1426,"context_line":"    if vm_ref is None:"},{"line_number":1427,"context_line":"        vm_ref \u003d get_vm_ref_by_uuid(session, instance[\u0027uuid\u0027] + suffix)"},{"line_number":1428,"context_line":"    if vm_ref is None:"},{"line_number":1429,"context_line":"        raise exception.InstanceNotFound(instance_id\u003dinstance[\u0027uuid\u0027] + suffix)"},{"line_number":1430,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2ZI%3D","line":1427,"in_reply_to":"AAAAWH%2F%2B3cQ%3D","updated":"2014-03-24 00:54:25.000000000","message":"Done","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1434,"context_line":"                        client_factory, extra_opts)"},{"line_number":1435,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027]"},{"line_number":1436,"context_line":"    reconfig_spec.instanceUuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1437,"context_line":"    LOG.debug(_(\"Associating VM to instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1438,"context_line":"               instance\u003dinstance)"},{"line_number":1439,"context_line":"    reconfig_task \u003d session._call_method("},{"line_number":1440,"context_line":"                                        session._get_vim(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2Q4%3D","line":1437,"updated":"2014-03-23 08:28:21.000000000","message":"ditto","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1434,"context_line":"                        client_factory, extra_opts)"},{"line_number":1435,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027]"},{"line_number":1436,"context_line":"    reconfig_spec.instanceUuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1437,"context_line":"    LOG.debug(_(\"Associating VM to instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1438,"context_line":"               instance\u003dinstance)"},{"line_number":1439,"context_line":"    reconfig_task \u003d session._call_method("},{"line_number":1440,"context_line":"                                        session._get_vim(),"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B0xw%3D","line":1437,"in_reply_to":"AAAAWH%2F%2B2Q4%3D","updated":"2014-03-24 00:54:25.000000000","message":"Done","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1440,"context_line":"                                        session._get_vim(),"},{"line_number":1441,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1442,"context_line":"                                        spec\u003dreconfig_spec)"},{"line_number":1443,"context_line":"    session._wait_for_task(reconfig_task)"},{"line_number":1444,"context_line":"    LOG.debug(_(\"Associated VM to instance %s\") % instance[\u0027uuid\u0027],"},{"line_number":1445,"context_line":"               instance\u003dinstance)"},{"line_number":1446,"context_line":"    # Invalidate the cache, so that it is refetched the next time"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2Q0%3D","line":1443,"updated":"2014-03-23 08:28:21.000000000","message":"the task returns the moref of the VM","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7b75bc208f8d6d36cf319b4f0ac3e86659d39729","unresolved":false,"context_lines":[{"line_number":837,"context_line":""},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"def get_vm_ref_by_uuid(session, uuid):"},{"line_number":840,"context_line":"    \"\"\"Get reference to the VM through uuid. This method"},{"line_number":841,"context_line":"    is primarily meant to separate out part of the logic for"},{"line_number":842,"context_line":"    vm_ref search that could be use directly in the special case"},{"line_number":843,"context_line":"    of migrating the instance. For querying VM linked to an instance"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2BzuI%3D","line":840,"updated":"2014-03-24 07:02:30.000000000","message":"Minor nit. Should be:\n\n\"\"\"Get reference to the VM through uuid.\n\nThis method ...","commit_id":"af6c64f7a42d9a8a711f3d3e8a0becb8696bb523"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7b75bc208f8d6d36cf319b4f0ac3e86659d39729","unresolved":false,"context_lines":[{"line_number":1364,"context_line":""},{"line_number":1365,"context_line":"def clone_vmref_for_instance(session, instance, vm_ref, host_ref, ds_ref,"},{"line_number":1366,"context_line":"                                vmfolder_ref):"},{"line_number":1367,"context_line":"    \"\"\"Clones the passed vm_ref into a new VM and links the cloned vm to"},{"line_number":1368,"context_line":"    the passed instance"},{"line_number":1369,"context_line":"    \"\"\""},{"line_number":1370,"context_line":"    # Get the clone vm spec"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2Bzp4%3D","line":1367,"updated":"2014-03-24 07:02:30.000000000","message":"Minor nit here regarding the docstring. The firt sentence should be a short explanation of what the method does and after that the explanation - you can look at http://legacy.python.org/dev/peps/pep-0257/ for more explanations","commit_id":"af6c64f7a42d9a8a711f3d3e8a0becb8696bb523"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7b75bc208f8d6d36cf319b4f0ac3e86659d39729","unresolved":false,"context_lines":[{"line_number":1370,"context_line":"    # Get the clone vm spec"},{"line_number":1371,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1372,"context_line":"    rel_spec \u003d relocate_vm_spec(client_factory, ds_ref, host_ref)"},{"line_number":1373,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"},{"line_number":1374,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1375,"context_line":"    reconfig_spec.instanceUuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1376,"context_line":"    clone_spec \u003d clone_vm_spec(client_factory, rel_spec, config\u003dreconfig_spec)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2Bzo4%3D","line":1373,"updated":"2014-03-24 07:02:30.000000000","message":"lines 1373 - 1375 could be moved to a helper method - this is repeated in each of the methods below","commit_id":"af6c64f7a42d9a8a711f3d3e8a0becb8696bb523"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7b75bc208f8d6d36cf319b4f0ac3e86659d39729","unresolved":false,"context_lines":[{"line_number":1384,"context_line":"                            folder\u003dvmfolder_ref,"},{"line_number":1385,"context_line":"                            name\u003dinstance[\u0027uuid\u0027],"},{"line_number":1386,"context_line":"                            spec\u003dclone_spec)"},{"line_number":1387,"context_line":"    session._wait_for_task(vm_clone_task)"},{"line_number":1388,"context_line":"    LOG.debug(_(\"Cloned VM for instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1389,"context_line":"               instance\u003dinstance)"},{"line_number":1390,"context_line":"    # Invalidate the cache, so that it is refetched the next time"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2BztE%3D","line":1387,"updated":"2014-03-24 07:02:30.000000000","message":"The clone task returns the moref of the clone vm.\ntaskinfo \u003d session._wait_for_task(vm_clone_task)\nclone_vm_ref \u003d taskinfo.result\n\nAfter deleting the vm_ref below you can cache the new one saving a round trip to the backend to get the new ref","commit_id":"af6c64f7a42d9a8a711f3d3e8a0becb8696bb523"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7b75bc208f8d6d36cf319b4f0ac3e86659d39729","unresolved":false,"context_lines":[{"line_number":1388,"context_line":"    LOG.debug(_(\"Cloned VM for instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1389,"context_line":"               instance\u003dinstance)"},{"line_number":1390,"context_line":"    # Invalidate the cache, so that it is refetched the next time"},{"line_number":1391,"context_line":"    vm_ref_cache_delete(instance[\u0027uuid\u0027])"},{"line_number":1392,"context_line":""},{"line_number":1393,"context_line":""},{"line_number":1394,"context_line":"def disassociate_vmref_from_instance(session, instance, vm_ref\u003dNone,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2Bzq8%3D","line":1391,"updated":"2014-03-24 07:02:30.000000000","message":"You could add a decorator to this method that first purges the original uuid from the cach, then runs the called method and then updates the vm_ref (the method should return that)\n\nThat is an enhance that can be done afterwards - this could certainly use the code that is being worked on in https://review.openstack.org/#/c/79833/","commit_id":"af6c64f7a42d9a8a711f3d3e8a0becb8696bb523"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7b75bc208f8d6d36cf319b4f0ac3e86659d39729","unresolved":false,"context_lines":[{"line_number":1393,"context_line":""},{"line_number":1394,"context_line":"def disassociate_vmref_from_instance(session, instance, vm_ref\u003dNone,"},{"line_number":1395,"context_line":"                                      suffix\u003d\u0027-orig\u0027):"},{"line_number":1396,"context_line":"    \"\"\"Disassociates the VM linked to the instance by performing the following"},{"line_number":1397,"context_line":"    1. Update the extraConfig property for nvp.vm-uuid to be replaced with"},{"line_number":1398,"context_line":"    instance[uuid]+suffix"},{"line_number":1399,"context_line":"    2. Rename the VM to be instance[uuid]+suffix instead"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2Bzps%3D","line":1396,"updated":"2014-03-24 07:02:30.000000000","message":"same as above with the docstring","commit_id":"af6c64f7a42d9a8a711f3d3e8a0becb8696bb523"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7b75bc208f8d6d36cf319b4f0ac3e86659d39729","unresolved":false,"context_lines":[{"line_number":1413,"context_line":"                                        session._get_vim(),"},{"line_number":1414,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1415,"context_line":"                                        spec\u003dreconfig_spec)"},{"line_number":1416,"context_line":"    session._wait_for_task(reconfig_task)"},{"line_number":1417,"context_line":"    LOG.debug(_(\"Disassociated VM from instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1418,"context_line":"               instance\u003dinstance)"},{"line_number":1419,"context_line":"    # Invalidate the cache, so that it is refetched the next time"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2BzqI%3D","line":1416,"updated":"2014-03-24 07:02:30.000000000","message":"The VM ref can also be retrieved from the result here:\n\n  key \u003d \"task-12780\"\n   task \u003d \n      (task){\n         value \u003d \"task-12780\"\n         _type \u003d \"Task\"\n      }\n   name \u003d \"ReconfigVM_Task\"\n   descriptionId \u003d \"VirtualMachine.reconfigure\"\n   entity \u003d \n      (entity){\n         value \u003d \"vm-1447\"\n         _type \u003d \"VirtualMachine\"\n      }\n   entityName \u003d \"4fd78404-6755-405c-80e6-5c8b4d40f5c2\"\n   state \u003d \"success\"\n   cancelled \u003d False\n   cancelable \u003d False\n   reason \u003d \n      (TaskReasonUser){\n         userName \u003d \"Administrator\"\n      }\n   queueTime \u003d 2014-03-23 22:54:11.001214\n   startTime \u003d 2014-03-23 22:54:11.001214\n   completeTime \u003d 2014-03-23 22:54:11.007298\n   eventChainId \u003d 61504\n }\n\nThis could be done later as an enhancement","commit_id":"af6c64f7a42d9a8a711f3d3e8a0becb8696bb523"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7b75bc208f8d6d36cf319b4f0ac3e86659d39729","unresolved":false,"context_lines":[{"line_number":1422,"context_line":""},{"line_number":1423,"context_line":"def associate_vmref_for_instance(session, instance, vm_ref\u003dNone,"},{"line_number":1424,"context_line":"                                    suffix\u003d\u0027-orig\u0027):"},{"line_number":1425,"context_line":"    \"\"\"Associates the VM to the instance by performing the following"},{"line_number":1426,"context_line":"    1. Update the extraConfig property for nvp.vm-uuid to be replaced with"},{"line_number":1427,"context_line":"    instance[uuid]"},{"line_number":1428,"context_line":"    2. Rename the VM to be instance[uuid]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAWH%2F%2Bzpg%3D","line":1425,"updated":"2014-03-24 07:02:30.000000000","message":"ditto with the doctring","commit_id":"af6c64f7a42d9a8a711f3d3e8a0becb8696bb523"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":1382,"context_line":"    LOG.debug(_(\"Cloning VM for instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1383,"context_line":"               instance\u003dinstance)"},{"line_number":1384,"context_line":"    vm_clone_task \u003d session._call_method("},{"line_number":1385,"context_line":"                            session._get_vim(),"},{"line_number":1386,"context_line":"                            \"CloneVM_Task\", vm_ref,"},{"line_number":1387,"context_line":"                            folder\u003dvmfolder_ref,"},{"line_number":1388,"context_line":"                            name\u003dinstance[\u0027uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs8o%3D","line":1385,"updated":"2014-03-24 23:53:03.000000000","message":"I\u0027d move session._get_vim() to fit on line above it and shift other parameters right.  Should fit within 80 chars.","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":1382,"context_line":"    LOG.debug(_(\"Cloning VM for instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1383,"context_line":"               instance\u003dinstance)"},{"line_number":1384,"context_line":"    vm_clone_task \u003d session._call_method("},{"line_number":1385,"context_line":"                            session._get_vim(),"},{"line_number":1386,"context_line":"                            \"CloneVM_Task\", vm_ref,"},{"line_number":1387,"context_line":"                            folder\u003dvmfolder_ref,"},{"line_number":1388,"context_line":"                            name\u003dinstance[\u0027uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2BsrI%3D","line":1385,"in_reply_to":"AAAAWH%2F%2Bs8o%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1410,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1411,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec("},{"line_number":1412,"context_line":"                        client_factory, extra_opts)"},{"line_number":1413,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"},{"line_number":1414,"context_line":"    reconfig_spec.instanceUuid \u003d \u0027\u0027"},{"line_number":1415,"context_line":"    LOG.debug(_(\"Disassociating VM from instance %s\"), instance[\u0027uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs9I%3D","line":1412,"updated":"2014-03-24 23:53:03.000000000","message":"Should fit on one 80 character line above.","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1410,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1411,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec("},{"line_number":1412,"context_line":"                        client_factory, extra_opts)"},{"line_number":1413,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"},{"line_number":1414,"context_line":"    reconfig_spec.instanceUuid \u003d \u0027\u0027"},{"line_number":1415,"context_line":"    LOG.debug(_(\"Disassociating VM from instance %s\"), instance[\u0027uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2BsrA%3D","line":1412,"in_reply_to":"AAAAWH%2F%2Bs9I%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":1415,"context_line":"    LOG.debug(_(\"Disassociating VM from instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1416,"context_line":"               instance\u003dinstance)"},{"line_number":1417,"context_line":"    reconfig_task \u003d session._call_method("},{"line_number":1418,"context_line":"                                        session._get_vim(),"},{"line_number":1419,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1420,"context_line":"                                        spec\u003dreconfig_spec)"},{"line_number":1421,"context_line":"    session._wait_for_task(reconfig_task)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs80%3D","line":1418,"updated":"2014-03-24 23:53:03.000000000","message":"I\u0027d move session._get_vim() to fit on line above it.","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":1415,"context_line":"    LOG.debug(_(\"Disassociating VM from instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1416,"context_line":"               instance\u003dinstance)"},{"line_number":1417,"context_line":"    reconfig_task \u003d session._call_method("},{"line_number":1418,"context_line":"                                        session._get_vim(),"},{"line_number":1419,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1420,"context_line":"                                        spec\u003dreconfig_spec)"},{"line_number":1421,"context_line":"    session._wait_for_task(reconfig_task)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bsq8%3D","line":1418,"in_reply_to":"AAAAWH%2F%2Bs80%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":1437,"context_line":"    \"\"\""},{"line_number":1438,"context_line":"    if vm_ref is None:"},{"line_number":1439,"context_line":"        vm_ref \u003d get_vm_ref_by_uuid(session, instance[\u0027uuid\u0027] + suffix)"},{"line_number":1440,"context_line":"    if vm_ref is None:"},{"line_number":1441,"context_line":"        raise exception.InstanceNotFound(instance_id\u003dinstance[\u0027uuid\u0027] + suffix)"},{"line_number":1442,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"},{"line_number":1443,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs%2BA%3D","line":1440,"updated":"2014-03-24 23:53:03.000000000","message":"Shouldn\u0027t you indent this line and next?  Otherwise you check twice if vm_ref was not None.","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":1437,"context_line":"    \"\"\""},{"line_number":1438,"context_line":"    if vm_ref is None:"},{"line_number":1439,"context_line":"        vm_ref \u003d get_vm_ref_by_uuid(session, instance[\u0027uuid\u0027] + suffix)"},{"line_number":1440,"context_line":"    if vm_ref is None:"},{"line_number":1441,"context_line":"        raise exception.InstanceNotFound(instance_id\u003dinstance[\u0027uuid\u0027] + suffix)"},{"line_number":1442,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"},{"line_number":1443,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bsqw%3D","line":1440,"in_reply_to":"AAAAWH%2F%2Bs%2BA%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":1443,"context_line":""},{"line_number":1444,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1445,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec("},{"line_number":1446,"context_line":"                        client_factory, extra_opts)"},{"line_number":1447,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027]"},{"line_number":1448,"context_line":"    reconfig_spec.instanceUuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1449,"context_line":"    LOG.debug(_(\"Associating VM to instance %s\"), instance[\u0027uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs9w%3D","line":1446,"updated":"2014-03-24 23:53:03.000000000","message":"No need to wrap line.  It should fit within 80 characters.","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":1443,"context_line":""},{"line_number":1444,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1445,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec("},{"line_number":1446,"context_line":"                        client_factory, extra_opts)"},{"line_number":1447,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027]"},{"line_number":1448,"context_line":"    reconfig_spec.instanceUuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1449,"context_line":"    LOG.debug(_(\"Associating VM to instance %s\"), instance[\u0027uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bsqs%3D","line":1446,"in_reply_to":"AAAAWH%2F%2Bs9w%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"e2b3510aaaf3b7f539d029de611109619a71f360","unresolved":false,"context_lines":[{"line_number":1449,"context_line":"    LOG.debug(_(\"Associating VM to instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1450,"context_line":"               instance\u003dinstance)"},{"line_number":1451,"context_line":"    reconfig_task \u003d session._call_method("},{"line_number":1452,"context_line":"                                        session._get_vim(),"},{"line_number":1453,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1454,"context_line":"                                        spec\u003dreconfig_spec)"},{"line_number":1455,"context_line":"    session._wait_for_task(reconfig_task)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bs9o%3D","line":1452,"updated":"2014-03-24 23:53:03.000000000","message":"I\u0027d move session._get_vim() to fit on line above it.","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"22cb02d69e020b0644b34a9935ce5c12549a5432","unresolved":false,"context_lines":[{"line_number":1449,"context_line":"    LOG.debug(_(\"Associating VM to instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1450,"context_line":"               instance\u003dinstance)"},{"line_number":1451,"context_line":"    reconfig_task \u003d session._call_method("},{"line_number":1452,"context_line":"                                        session._get_vim(),"},{"line_number":1453,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1454,"context_line":"                                        spec\u003dreconfig_spec)"},{"line_number":1455,"context_line":"    session._wait_for_task(reconfig_task)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAWH%2F%2Bsqo%3D","line":1452,"in_reply_to":"AAAAWH%2F%2Bs9o%3D","updated":"2014-03-25 00:24:26.000000000","message":"Done","commit_id":"5374eaabaeae3362310fac44121b894e31c9a7d8"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"d55fd724b10febcd79b867df7054fb793424841e","unresolved":false,"context_lines":[{"line_number":836,"context_line":"    return vm_ref"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"def get_vm_ref_by_uuid(session, uuid):"},{"line_number":840,"context_line":"    \"\"\"Get reference to the VM through uuid."},{"line_number":841,"context_line":""},{"line_number":842,"context_line":"    This method is primarily meant to separate out part of the logic for"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2Bom0%3D","line":839,"updated":"2014-03-25 12:31:37.000000000","message":"I really don\u0027t understand what we call uuid. If we accept the definition at http://en.wikipedia.org/wiki/Universally_unique_identifier then this function has a wrong name.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"0a50022f829bd5fdefeb557c61710835546e7695","unresolved":false,"context_lines":[{"line_number":836,"context_line":"    return vm_ref"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":""},{"line_number":839,"context_line":"def get_vm_ref_by_uuid(session, uuid):"},{"line_number":840,"context_line":"    \"\"\"Get reference to the VM through uuid."},{"line_number":841,"context_line":""},{"line_number":842,"context_line":"    This method is primarily meant to separate out part of the logic for"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BlDs%3D","line":839,"in_reply_to":"AAAAWH%2F%2Bom0%3D","updated":"2014-03-25 19:22:32.000000000","message":"Done","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"d55fd724b10febcd79b867df7054fb793424841e","unresolved":false,"context_lines":[{"line_number":844,"context_line":"    migrating the instance. For querying VM linked to an instance always"},{"line_number":845,"context_line":"    use get_vm_ref instead."},{"line_number":846,"context_line":"    \"\"\""},{"line_number":847,"context_line":"    vm_ref \u003d (_get_vm_ref_from_vm_uuid(session, uuid) or"},{"line_number":848,"context_line":"                  _get_vm_ref_from_extraconfig(session, uuid) or"},{"line_number":849,"context_line":"                  _get_vm_ref_from_uuid(session, uuid))"},{"line_number":850,"context_line":"    return vm_ref"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BoqI%3D","line":847,"updated":"2014-03-25 12:31:37.000000000","message":"you can check if vm_ref is None and throw exception like the method above; this way you won\u0027t have to check the result every time this function is called","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"864639fcd7ae5978d31cee701d7633e69968372d","unresolved":false,"context_lines":[{"line_number":844,"context_line":"    migrating the instance. For querying VM linked to an instance always"},{"line_number":845,"context_line":"    use get_vm_ref instead."},{"line_number":846,"context_line":"    \"\"\""},{"line_number":847,"context_line":"    vm_ref \u003d (_get_vm_ref_from_vm_uuid(session, uuid) or"},{"line_number":848,"context_line":"                  _get_vm_ref_from_extraconfig(session, uuid) or"},{"line_number":849,"context_line":"                  _get_vm_ref_from_uuid(session, uuid))"},{"line_number":850,"context_line":"    return vm_ref"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BoWs%3D","line":847,"in_reply_to":"AAAAWH%2F%2BoqI%3D","updated":"2014-03-25 13:14:10.000000000","message":"i do not think that this will work as this is called above in get_vm_ref and if there is no match with the uuid then the name should be searched","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d04306e2e4f1beaacebe4bd6b7b71b50d2b5537e","unresolved":false,"context_lines":[{"line_number":1371,"context_line":"    the passed instance"},{"line_number":1372,"context_line":"    \"\"\""},{"line_number":1373,"context_line":"    # Get the clone vm spec"},{"line_number":1374,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1375,"context_line":"    rel_spec \u003d relocate_vm_spec(client_factory, ds_ref, host_ref)"},{"line_number":1376,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"},{"line_number":1377,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BpPQ%3D","line":1374,"updated":"2014-03-25 14:30:20.000000000","message":"This function both creates SOAP objects and calls a method, which means it must be retried entirely in the event of session failure. This whole function needs to be called via _call_method().\n\nIncidentally, this highlights a deficiency in the Vim API. Ideally the function would use something like a session management decorator here and the caller would not have to remember how to call it.\n\nIn fact, you might consider implementing clone_vmref_for_instance as a wrapper function which calls the implementation function via _call_method().","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"30fefa0e5ad90f65503d2977ede0652bed5537e7","unresolved":false,"context_lines":[{"line_number":1371,"context_line":"    the passed instance"},{"line_number":1372,"context_line":"    \"\"\""},{"line_number":1373,"context_line":"    # Get the clone vm spec"},{"line_number":1374,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1375,"context_line":"    rel_spec \u003d relocate_vm_spec(client_factory, ds_ref, host_ref)"},{"line_number":1376,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"},{"line_number":1377,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2Bk%2B4%3D","line":1374,"in_reply_to":"AAAAWH%2F%2BpPQ%3D","updated":"2014-03-25 19:20:31.000000000","message":"@Matthew Booth:\n_get_vim handles session failure in create_session. Also, _get_vim.client.factory doesn\u0027t make a SOAP call to the server, it returns the factory object from suds.\n\nNot sure, why the entire method needs to be wrapped in _call_method unless it\u0027s an api call.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d04306e2e4f1beaacebe4bd6b7b71b50d2b5537e","unresolved":false,"context_lines":[{"line_number":1374,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1375,"context_line":"    rel_spec \u003d relocate_vm_spec(client_factory, ds_ref, host_ref)"},{"line_number":1376,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"},{"line_number":1377,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1378,"context_line":"    reconfig_spec.instanceUuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1379,"context_line":"    clone_spec \u003d clone_vm_spec(client_factory, rel_spec, config\u003dreconfig_spec)"},{"line_number":1380,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BpAg%3D","line":1377,"updated":"2014-03-25 14:30:20.000000000","message":"Nit: not really a reconfig.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"0a50022f829bd5fdefeb557c61710835546e7695","unresolved":false,"context_lines":[{"line_number":1374,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1375,"context_line":"    rel_spec \u003d relocate_vm_spec(client_factory, ds_ref, host_ref)"},{"line_number":1376,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"},{"line_number":1377,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1378,"context_line":"    reconfig_spec.instanceUuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1379,"context_line":"    clone_spec \u003d clone_vm_spec(client_factory, rel_spec, config\u003dreconfig_spec)"},{"line_number":1380,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2Bk9o%3D","line":1377,"in_reply_to":"AAAAWH%2F%2BpAg%3D","updated":"2014-03-25 19:22:32.000000000","message":"Done","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d04306e2e4f1beaacebe4bd6b7b71b50d2b5537e","unresolved":false,"context_lines":[{"line_number":1381,"context_line":"    # Clone VM on ESX host"},{"line_number":1382,"context_line":"    LOG.debug(_(\"Cloning VM for instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1383,"context_line":"               instance\u003dinstance)"},{"line_number":1384,"context_line":"    vm_clone_task \u003d session._call_method(session._get_vim(), \"CloneVM_Task\","},{"line_number":1385,"context_line":"                                         vm_ref, folder\u003dvmfolder_ref,"},{"line_number":1386,"context_line":"                                         name\u003dinstance[\u0027uuid\u0027],"},{"line_number":1387,"context_line":"                                         spec\u003dclone_spec)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BpL8%3D","line":1384,"updated":"2014-03-25 14:30:20.000000000","message":"This function needs to be called via _call_method, which means that _call_method cannot be used inside it.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"d55fd724b10febcd79b867df7054fb793424841e","unresolved":false,"context_lines":[{"line_number":1403,"context_line":"    3. Reset the instanceUUID of the VM to a new generated value"},{"line_number":1404,"context_line":"    \"\"\""},{"line_number":1405,"context_line":"    if vm_ref is None:"},{"line_number":1406,"context_line":"        vm_ref \u003d get_vm_ref(session, instance)"},{"line_number":1407,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1408,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1409,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2Boq0%3D","line":1406,"updated":"2014-03-25 12:31:37.000000000","message":"do we need to throw InstanceNotFound if vm_ref is None?","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"0a50022f829bd5fdefeb557c61710835546e7695","unresolved":false,"context_lines":[{"line_number":1403,"context_line":"    3. Reset the instanceUUID of the VM to a new generated value"},{"line_number":1404,"context_line":"    \"\"\""},{"line_number":1405,"context_line":"    if vm_ref is None:"},{"line_number":1406,"context_line":"        vm_ref \u003d get_vm_ref(session, instance)"},{"line_number":1407,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1408,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1409,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BlDU%3D","line":1406,"in_reply_to":"AAAAWH%2F%2Boq0%3D","updated":"2014-03-25 19:22:32.000000000","message":"The get_vm_ref method will throw that exception in case of vm_ref not being found","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d04306e2e4f1beaacebe4bd6b7b71b50d2b5537e","unresolved":false,"context_lines":[{"line_number":1405,"context_line":"    if vm_ref is None:"},{"line_number":1406,"context_line":"        vm_ref \u003d get_vm_ref(session, instance)"},{"line_number":1407,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1408,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1409,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1410,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"},{"line_number":1411,"context_line":"    reconfig_spec.instanceUuid \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BpH8%3D","line":1408,"updated":"2014-03-25 14:30:20.000000000","message":"Same as above. This function needs session management.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d04306e2e4f1beaacebe4bd6b7b71b50d2b5537e","unresolved":false,"context_lines":[{"line_number":1411,"context_line":"    reconfig_spec.instanceUuid \u003d \u0027\u0027"},{"line_number":1412,"context_line":"    LOG.debug(_(\"Disassociating VM from instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1413,"context_line":"               instance\u003dinstance)"},{"line_number":1414,"context_line":"    reconfig_task \u003d session._call_method(session._get_vim(), \"ReconfigVM_Task\","},{"line_number":1415,"context_line":"                                         vm_ref, spec\u003dreconfig_spec)"},{"line_number":1416,"context_line":"    session._wait_for_task(reconfig_task)"},{"line_number":1417,"context_line":"    LOG.debug(_(\"Disassociated VM from instance %s\"), instance[\u0027uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BpHw%3D","line":1414,"updated":"2014-03-25 14:30:20.000000000","message":"Same as above. _call_method can\u0027t be used here.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"d55fd724b10febcd79b867df7054fb793424841e","unresolved":false,"context_lines":[{"line_number":1431,"context_line":"    3. Reset the instanceUUID of the VM to be instance[uuid]"},{"line_number":1432,"context_line":"    \"\"\""},{"line_number":1433,"context_line":"    if vm_ref is None:"},{"line_number":1434,"context_line":"        vm_ref \u003d get_vm_ref_by_uuid(session, instance[\u0027uuid\u0027] + suffix)"},{"line_number":1435,"context_line":"        if vm_ref is None:"},{"line_number":1436,"context_line":"            raise exception.InstanceNotFound(instance_id\u003dinstance[\u0027uuid\u0027]"},{"line_number":1437,"context_line":"                                            + suffix)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2Boo8%3D","line":1434,"updated":"2014-03-25 12:31:37.000000000","message":"uuid + \"-orig\" doesn\u0027t make an uuid","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"0a50022f829bd5fdefeb557c61710835546e7695","unresolved":false,"context_lines":[{"line_number":1431,"context_line":"    3. Reset the instanceUUID of the VM to be instance[uuid]"},{"line_number":1432,"context_line":"    \"\"\""},{"line_number":1433,"context_line":"    if vm_ref is None:"},{"line_number":1434,"context_line":"        vm_ref \u003d get_vm_ref_by_uuid(session, instance[\u0027uuid\u0027] + suffix)"},{"line_number":1435,"context_line":"        if vm_ref is None:"},{"line_number":1436,"context_line":"            raise exception.InstanceNotFound(instance_id\u003dinstance[\u0027uuid\u0027]"},{"line_number":1437,"context_line":"                                            + suffix)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BlDQ%3D","line":1434,"in_reply_to":"AAAAWH%2F%2Boo8%3D","updated":"2014-03-25 19:22:32.000000000","message":"Hopefully, the renamed method should address your concern","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d04306e2e4f1beaacebe4bd6b7b71b50d2b5537e","unresolved":false,"context_lines":[{"line_number":1436,"context_line":"            raise exception.InstanceNotFound(instance_id\u003dinstance[\u0027uuid\u0027]"},{"line_number":1437,"context_line":"                                            + suffix)"},{"line_number":1438,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027]}"},{"line_number":1439,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1440,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1441,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027]"},{"line_number":1442,"context_line":"    reconfig_spec.instanceUuid \u003d instance[\u0027uuid\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BpH4%3D","line":1439,"updated":"2014-03-25 14:30:20.000000000","message":"Same as above. This function needs session management.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d04306e2e4f1beaacebe4bd6b7b71b50d2b5537e","unresolved":false,"context_lines":[{"line_number":1442,"context_line":"    reconfig_spec.instanceUuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1443,"context_line":"    LOG.debug(_(\"Associating VM to instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1444,"context_line":"               instance\u003dinstance)"},{"line_number":1445,"context_line":"    reconfig_task \u003d session._call_method(session._get_vim(), \"ReconfigVM_Task\","},{"line_number":1446,"context_line":"                                         vm_ref, spec\u003dreconfig_spec)"},{"line_number":1447,"context_line":"    session._wait_for_task(reconfig_task)"},{"line_number":1448,"context_line":"    LOG.debug(_(\"Associated VM to instance %s\"), instance[\u0027uuid\u0027],"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BpHo%3D","line":1445,"updated":"2014-03-25 14:30:20.000000000","message":"Same as above. _call_method can\u0027t be used here.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"d51b7c53f39f2709c055187309c4f04e89018ed4","unresolved":false,"context_lines":[{"line_number":1369,"context_line":"    \"\"\"Clone VM and link the cloned VM to the instance."},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"    Clones the passed vm_ref into a new VM and links the cloned vm to"},{"line_number":1372,"context_line":"    the passed instance"},{"line_number":1373,"context_line":"    \"\"\""},{"line_number":1374,"context_line":"    if vm_ref is None:"},{"line_number":1375,"context_line":"        LOG.warn(_(\"vmwareapi:vm_util:clone_vmref_for_instance, called \""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAWH%2F%2BisM%3D","line":1372,"updated":"2014-03-26 02:51:38.000000000","message":"\"and links the cloned vm to the passed instance\"\nThis is not done in the method, remove this or change it to \"and invalidate the cache entry of the original vm_ref\"","commit_id":"1470fc5168c73ddc7d486d2d510232ba27e9da01"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"183558dd6f80282ddfc4df6f2a8efda9d216ecb7","unresolved":false,"context_lines":[{"line_number":1369,"context_line":"    \"\"\"Clone VM and link the cloned VM to the instance."},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"    Clones the passed vm_ref into a new VM and links the cloned vm to"},{"line_number":1372,"context_line":"    the passed instance"},{"line_number":1373,"context_line":"    \"\"\""},{"line_number":1374,"context_line":"    if vm_ref is None:"},{"line_number":1375,"context_line":"        LOG.warn(_(\"vmwareapi:vm_util:clone_vmref_for_instance, called \""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAWH%2F%2Binc%3D","line":1372,"in_reply_to":"AAAAWH%2F%2BisM%3D","updated":"2014-03-26 02:58:21.000000000","message":"The linkage to the instance is also done.\nThe clone operation also takes a config spec that does the linkage. See line#1381-1384 for details","commit_id":"1470fc5168c73ddc7d486d2d510232ba27e9da01"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"05fe1222cfe9c5673e3d042519f6099e642942c8","unresolved":false,"context_lines":[{"line_number":1369,"context_line":"    \"\"\"Clone VM and link the cloned VM to the instance."},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"    Clones the passed vm_ref into a new VM and links the cloned vm to"},{"line_number":1372,"context_line":"    the passed instance"},{"line_number":1373,"context_line":"    \"\"\""},{"line_number":1374,"context_line":"    if vm_ref is None:"},{"line_number":1375,"context_line":"        LOG.warn(_(\"vmwareapi:vm_util:clone_vmref_for_instance, called \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2BeZg%3D","line":1372,"updated":"2014-03-26 15:20:40.000000000","message":"Nit: instance -\u003e instance.","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"1d708c08d03cc315e5885fb11311a01139828a6c","unresolved":false,"context_lines":[{"line_number":1369,"context_line":"    \"\"\"Clone VM and link the cloned VM to the instance."},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"    Clones the passed vm_ref into a new VM and links the cloned vm to"},{"line_number":1372,"context_line":"    the passed instance"},{"line_number":1373,"context_line":"    \"\"\""},{"line_number":1374,"context_line":"    if vm_ref is None:"},{"line_number":1375,"context_line":"        LOG.warn(_(\"vmwareapi:vm_util:clone_vmref_for_instance, called \""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2BcfY%3D","line":1372,"in_reply_to":"AAAAWH%2F%2BeZg%3D","updated":"2014-03-26 18:28:22.000000000","message":"Done","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"25ca596d92962aca069c2f01582c08736335d2f6","unresolved":false,"context_lines":[{"line_number":1372,"context_line":"    the passed instance"},{"line_number":1373,"context_line":"    \"\"\""},{"line_number":1374,"context_line":"    if vm_ref is None:"},{"line_number":1375,"context_line":"        LOG.warn(_(\"vmwareapi:vm_util:clone_vmref_for_instance, called \""},{"line_number":1376,"context_line":"         \"with vm_ref\u003dNone\"))"},{"line_number":1377,"context_line":"        raise error_util.MissingParameter(param\u003d\"vm_ref\")"},{"line_number":1378,"context_line":"    # Get the clone vm spec"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2Bgzk%3D","line":1375,"updated":"2014-03-26 12:03:59.000000000","message":"nit: this log is redundant given that we raise exception on the next line","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"e624bf0e7998708ebc2de3e5e688dbf99aa394d9","unresolved":false,"context_lines":[{"line_number":1372,"context_line":"    the passed instance"},{"line_number":1373,"context_line":"    \"\"\""},{"line_number":1374,"context_line":"    if vm_ref is None:"},{"line_number":1375,"context_line":"        LOG.warn(_(\"vmwareapi:vm_util:clone_vmref_for_instance, called \""},{"line_number":1376,"context_line":"         \"with vm_ref\u003dNone\"))"},{"line_number":1377,"context_line":"        raise error_util.MissingParameter(param\u003d\"vm_ref\")"},{"line_number":1378,"context_line":"    # Get the clone vm spec"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2BcsQ%3D","line":1375,"in_reply_to":"AAAAWH%2F%2Bgzk%3D","updated":"2014-03-26 18:02:41.000000000","message":"I just added that so that when looking into the logs it is slightly easier to see what happened","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"e624bf0e7998708ebc2de3e5e688dbf99aa394d9","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"    \"\"\""},{"line_number":1410,"context_line":"    if vm_ref is None:"},{"line_number":1411,"context_line":"        vm_ref \u003d get_vm_ref(session, instance)"},{"line_number":1412,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1413,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1414,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1415,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2Bcyk%3D","line":1412,"updated":"2014-03-26 18:02:41.000000000","message":"@rado,@mbooth: The reason this needs to stay like this is, we want to make sure that we can get the reference to this vm in the context of the openstack instance later as well. e.g. when the user chooses the back out of the resize then we want to find this vm again and then re-do the linkage. \n\nIf we put the nvp.vm-uuid as null, then we loose the original context of what this VM was used for originally.\n\nHaving said the above one could argue that we are renaming that VM as well with the same uuid+suffix, and that it should be sufficient for our purpose. I wanted to mention here that even if that does solve the problem temporarily, but since \"name\" being a field that is quickly editable by any user who is using a client. Thus it makes it less reliable, which was the original reason why we moved away from relying on the name for linkage at the first place.","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"25ca596d92962aca069c2f01582c08736335d2f6","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"    \"\"\""},{"line_number":1410,"context_line":"    if vm_ref is None:"},{"line_number":1411,"context_line":"        vm_ref \u003d get_vm_ref(session, instance)"},{"line_number":1412,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1413,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1414,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1415,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2Bf2Q%3D","line":1412,"updated":"2014-03-26 12:03:59.000000000","message":"this is wrong: uuid+suffix !\u003d uuid","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"79bd7d4546a4e965e2ae040325caffe81da8da4d","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"    \"\"\""},{"line_number":1410,"context_line":"    if vm_ref is None:"},{"line_number":1411,"context_line":"        vm_ref \u003d get_vm_ref(session, instance)"},{"line_number":1412,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1413,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1414,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1415,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2Bfgw%3D","line":1412,"in_reply_to":"AAAAWH%2F%2Bf2Q%3D","updated":"2014-03-26 12:48:27.000000000","message":"in order for neutron to be able to work this key is required - \"nvp.vm-uuid\u0027","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"5f4d845722ee10f559d864f84f16773ce2ae7de6","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"    \"\"\""},{"line_number":1410,"context_line":"    if vm_ref is None:"},{"line_number":1411,"context_line":"        vm_ref \u003d get_vm_ref(session, instance)"},{"line_number":1412,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1413,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1414,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1415,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2Becg%3D","line":1412,"in_reply_to":"AAAAWH%2F%2Bfbs%3D","updated":"2014-03-26 15:24:40.000000000","message":"In the specific case of nvp.vm-uuid you could simply null it. Its value here will never be used by anything.","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"9712355bf6f997981f2450da63c5497f6b392036","unresolved":false,"context_lines":[{"line_number":1409,"context_line":"    \"\"\""},{"line_number":1410,"context_line":"    if vm_ref is None:"},{"line_number":1411,"context_line":"        vm_ref \u003d get_vm_ref(session, instance)"},{"line_number":1412,"context_line":"    extra_opts \u003d {\u0027nvp.vm-uuid\u0027: instance[\u0027uuid\u0027] + suffix}"},{"line_number":1413,"context_line":"    client_factory \u003d session._get_vim().client.factory"},{"line_number":1414,"context_line":"    reconfig_spec \u003d get_vm_extra_config_spec(client_factory, extra_opts)"},{"line_number":1415,"context_line":"    reconfig_spec.name \u003d instance[\u0027uuid\u0027] + suffix"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2Bfbs%3D","line":1412,"in_reply_to":"AAAAWH%2F%2Bfgw%3D","updated":"2014-03-26 12:58:20.000000000","message":"that\u0027s fine, but why we assign something which is not uuid to a property named \u0027nvp.vm-uuid\u0027?","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"54bb252b41219402b6893a376c6c867897692bb9","unresolved":false,"context_lines":[{"line_number":846,"context_line":"    use get_vm_ref instead."},{"line_number":847,"context_line":"    \"\"\""},{"line_number":848,"context_line":"    vm_ref \u003d (_get_vm_ref_from_vm_uuid(session, identifier) or"},{"line_number":849,"context_line":"                  _get_vm_ref_from_extraconfig(session, identifier) or"},{"line_number":850,"context_line":"                  _get_vm_ref_from_uuid(session, identifier))"},{"line_number":851,"context_line":"    return vm_ref"},{"line_number":852,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQpA%3D","line":849,"updated":"2014-03-28 01:56:11.000000000","message":"Normally I\u0027d line up the indenting under the line above.","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"f2813f603c6b233e6cf4603dd7cab96a95a19d2b","unresolved":false,"context_lines":[{"line_number":846,"context_line":"    use get_vm_ref instead."},{"line_number":847,"context_line":"    \"\"\""},{"line_number":848,"context_line":"    vm_ref \u003d (_get_vm_ref_from_vm_uuid(session, identifier) or"},{"line_number":849,"context_line":"                  _get_vm_ref_from_extraconfig(session, identifier) or"},{"line_number":850,"context_line":"                  _get_vm_ref_from_uuid(session, identifier))"},{"line_number":851,"context_line":"    return vm_ref"},{"line_number":852,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQls%3D","line":849,"in_reply_to":"AAAAWH%2F%2BQpA%3D","updated":"2014-03-28 02:06:39.000000000","message":"Done","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"54bb252b41219402b6893a376c6c867897692bb9","unresolved":false,"context_lines":[{"line_number":1373,"context_line":"    \"\"\""},{"line_number":1374,"context_line":"    if vm_ref is None:"},{"line_number":1375,"context_line":"        LOG.warn(_(\"vmwareapi:vm_util:clone_vmref_for_instance, called \""},{"line_number":1376,"context_line":"         \"with vm_ref\u003dNone\"))"},{"line_number":1377,"context_line":"        raise error_util.MissingParameter(param\u003d\"vm_ref\")"},{"line_number":1378,"context_line":"    # Get the clone vm spec"},{"line_number":1379,"context_line":"    client_factory \u003d session._get_vim().client.factory"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQo4%3D","line":1376,"updated":"2014-03-28 01:56:11.000000000","message":"Indent to be under \" in first line.","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"f2813f603c6b233e6cf4603dd7cab96a95a19d2b","unresolved":false,"context_lines":[{"line_number":1373,"context_line":"    \"\"\""},{"line_number":1374,"context_line":"    if vm_ref is None:"},{"line_number":1375,"context_line":"        LOG.warn(_(\"vmwareapi:vm_util:clone_vmref_for_instance, called \""},{"line_number":1376,"context_line":"         \"with vm_ref\u003dNone\"))"},{"line_number":1377,"context_line":"        raise error_util.MissingParameter(param\u003d\"vm_ref\")"},{"line_number":1378,"context_line":"    # Get the clone vm spec"},{"line_number":1379,"context_line":"    client_factory \u003d session._get_vim().client.factory"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQlg%3D","line":1376,"in_reply_to":"AAAAWH%2F%2BQo4%3D","updated":"2014-03-28 02:06:39.000000000","message":"Done","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"013b6d49bdbb173091749602828458309c35a21d","unresolved":false,"context_lines":[{"line_number":1394,"context_line":"    LOG.debug(_(\"Cloned VM for instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1395,"context_line":"               instance\u003dinstance)"},{"line_number":1396,"context_line":"    # Invalidate the cache, so that it is refetched the next time"},{"line_number":1397,"context_line":"    vm_ref_cache_delete(instance[\u0027uuid\u0027])"},{"line_number":1398,"context_line":""},{"line_number":1399,"context_line":""},{"line_number":1400,"context_line":"def disassociate_vmref_from_instance(session, instance, vm_ref\u003dNone,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAWH%2F%2BNiI%3D","line":1397,"updated":"2014-03-28 11:40:27.000000000","message":"Seems a bit racey to do this after the clone, rather than before the clone. But that can be fixed, if it really is an issue, in a follow up patch.","commit_id":"44fa75313c870f6c79e10e5395bdaef0de9057e1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"013b6d49bdbb173091749602828458309c35a21d","unresolved":false,"context_lines":[{"line_number":1422,"context_line":"    LOG.debug(_(\"Disassociated VM from instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1423,"context_line":"               instance\u003dinstance)"},{"line_number":1424,"context_line":"    # Invalidate the cache, so that it is refetched the next time"},{"line_number":1425,"context_line":"    vm_ref_cache_delete(instance[\u0027uuid\u0027])"},{"line_number":1426,"context_line":""},{"line_number":1427,"context_line":""},{"line_number":1428,"context_line":"def associate_vmref_for_instance(session, instance, vm_ref\u003dNone,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAWH%2F%2BNiE%3D","line":1425,"updated":"2014-03-28 11:40:27.000000000","message":"as above.","commit_id":"44fa75313c870f6c79e10e5395bdaef0de9057e1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"013b6d49bdbb173091749602828458309c35a21d","unresolved":false,"context_lines":[{"line_number":1454,"context_line":"    LOG.debug(_(\"Associated VM to instance %s\"), instance[\u0027uuid\u0027],"},{"line_number":1455,"context_line":"               instance\u003dinstance)"},{"line_number":1456,"context_line":"    # Invalidate the cache, so that it is refetched the next time"},{"line_number":1457,"context_line":"    vm_ref_cache_delete(instance[\u0027uuid\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAWH%2F%2BNhg%3D","line":1457,"updated":"2014-03-28 11:40:27.000000000","message":"as above.","commit_id":"44fa75313c870f6c79e10e5395bdaef0de9057e1"}],"nova/virt/vmwareapi/vmops.py":[{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"6ad25db75766b0bda4c49edb8f13441cf672361b","unresolved":false,"context_lines":[{"line_number":1299,"context_line":"        # be found using the uuid buried in the extraConfig"},{"line_number":1300,"context_line":"        vm_ref \u003d vm_util.get_vm_ref_by_uuid(self._session,"},{"line_number":1301,"context_line":"                                    instance[\u0027uuid\u0027] + self._migrate_suffix)"},{"line_number":1302,"context_line":"        #vm_ref \u003d vm_util.get_vm_ref_from_name(self._session, instance_name)"},{"line_number":1303,"context_line":"        if vm_ref is None:"},{"line_number":1304,"context_line":"            LOG.debug(_(\"instance not present\"), instance\u003dinstance)"},{"line_number":1305,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B4fs%3D","line":1302,"updated":"2014-03-22 01:06:59.000000000","message":"You can remove this commented line.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1299,"context_line":"        # be found using the uuid buried in the extraConfig"},{"line_number":1300,"context_line":"        vm_ref \u003d vm_util.get_vm_ref_by_uuid(self._session,"},{"line_number":1301,"context_line":"                                    instance[\u0027uuid\u0027] + self._migrate_suffix)"},{"line_number":1302,"context_line":"        #vm_ref \u003d vm_util.get_vm_ref_from_name(self._session, instance_name)"},{"line_number":1303,"context_line":"        if vm_ref is None:"},{"line_number":1304,"context_line":"            LOG.debug(_(\"instance not present\"), instance\u003dinstance)"},{"line_number":1305,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2XM%3D","line":1302,"in_reply_to":"AAAAWH%2F%2B4fs%3D","updated":"2014-03-24 00:54:25.000000000","message":"Done","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"9b602238d59a6618c150963233ff9f8057f4024e","unresolved":false,"context_lines":[{"line_number":1321,"context_line":"        vm_util.associate_vmref_for_instance(self._session, instance,"},{"line_number":1322,"context_line":"                                             suffix\u003dself._migrate_suffix)"},{"line_number":1323,"context_line":"        if power_on:"},{"line_number":1324,"context_line":"            self._power_on(instance)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"    def finish_migration(self, context, migration, instance, disk_info,"},{"line_number":1327,"context_line":"                         network_info, image_meta, resize_instance\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B3VM%3D","line":1324,"updated":"2014-03-22 14:00:57.000000000","message":"_power_on uses cached call to get_vm_ref too.  So I\u0027m not sure it will power on the correct VM.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1321,"context_line":"        vm_util.associate_vmref_for_instance(self._session, instance,"},{"line_number":1322,"context_line":"                                             suffix\u003dself._migrate_suffix)"},{"line_number":1323,"context_line":"        if power_on:"},{"line_number":1324,"context_line":"            self._power_on(instance)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"    def finish_migration(self, context, migration, instance, disk_info,"},{"line_number":1327,"context_line":"                         network_info, image_meta, resize_instance\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2Ws%3D","line":1324,"in_reply_to":"AAAAWH%2F%2B3VM%3D","updated":"2014-03-24 00:54:25.000000000","message":"the get_vm_ref call will yield the right VM since the associate_vmref_for_instance method invalidates the cache. Thus this call will be forced to go though the vCenter server","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1321,"context_line":"        vm_util.associate_vmref_for_instance(self._session, instance,"},{"line_number":1322,"context_line":"                                             suffix\u003dself._migrate_suffix)"},{"line_number":1323,"context_line":"        if power_on:"},{"line_number":1324,"context_line":"            self._power_on(instance)"},{"line_number":1325,"context_line":""},{"line_number":1326,"context_line":"    def finish_migration(self, context, migration, instance, disk_info,"},{"line_number":1327,"context_line":"                         network_info, image_meta, resize_instance\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2Qs%3D","line":1324,"in_reply_to":"AAAAWH%2F%2B3VM%3D","updated":"2014-03-23 08:28:21.000000000","message":"yes, it uses the correct moref","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"9b602238d59a6618c150963233ff9f8057f4024e","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"        \"\"\"Completes a resize, turning on the migrated instance.\"\"\""},{"line_number":1330,"context_line":"        if resize_instance:"},{"line_number":1331,"context_line":"            client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1332,"context_line":"            vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1333,"context_line":"            vm_resize_spec \u003d vm_util.get_vm_resize_spec(client_factory,"},{"line_number":1334,"context_line":"                                                        instance)"},{"line_number":1335,"context_line":"            reconfig_task \u003d self._session._call_method("}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B3VU%3D","line":1332,"updated":"2014-03-22 14:00:57.000000000","message":"This cached get_vm_ref is also part of the migration/resize.  You probably need to fix this also.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"        \"\"\"Completes a resize, turning on the migrated instance.\"\"\""},{"line_number":1330,"context_line":"        if resize_instance:"},{"line_number":1331,"context_line":"            client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1332,"context_line":"            vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1333,"context_line":"            vm_resize_spec \u003d vm_util.get_vm_resize_spec(client_factory,"},{"line_number":1334,"context_line":"                                                        instance)"},{"line_number":1335,"context_line":"            reconfig_task \u003d self._session._call_method("}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2Qk%3D","line":1332,"in_reply_to":"AAAAWH%2F%2B3VU%3D","updated":"2014-03-23 08:28:21.000000000","message":"No, it is treated already.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"        \"\"\"Completes a resize, turning on the migrated instance.\"\"\""},{"line_number":1330,"context_line":"        if resize_instance:"},{"line_number":1331,"context_line":"            client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1332,"context_line":"            vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1333,"context_line":"            vm_resize_spec \u003d vm_util.get_vm_resize_spec(client_factory,"},{"line_number":1334,"context_line":"                                                        instance)"},{"line_number":1335,"context_line":"            reconfig_task \u003d self._session._call_method("}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2Vc%3D","line":1332,"in_reply_to":"AAAAWH%2F%2B3VU%3D","updated":"2014-03-24 00:54:25.000000000","message":"the get_vm_ref call will yield the right VM since all the 3 methods responsible for any linkage changes clone_vmref_for_instance, associate_vmref_for_instance, disassociate_vmref_for_instance method invalidates the cache as well. Thus this call will be forced to go though the vCenter server yielding the correct result","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"9b602238d59a6618c150963233ff9f8057f4024e","unresolved":false,"context_lines":[{"line_number":1338,"context_line":"                                            spec\u003dvm_resize_spec)"},{"line_number":1339,"context_line":""},{"line_number":1340,"context_line":"        # 4. Start VM"},{"line_number":1341,"context_line":"        if power_on:"},{"line_number":1342,"context_line":"            self._power_on(instance)"},{"line_number":1343,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1344,"context_line":"                                       step\u003d4,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B3VQ%3D","line":1341,"updated":"2014-03-22 14:00:57.000000000","message":"_power_on uses cached call to get_vm_ref again, but you can pass a vm_ref, which would make better sense here.","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7ce34eaa49f09edbca3b82fbd98acad20e33dffd","unresolved":false,"context_lines":[{"line_number":1338,"context_line":"                                            spec\u003dvm_resize_spec)"},{"line_number":1339,"context_line":""},{"line_number":1340,"context_line":"        # 4. Start VM"},{"line_number":1341,"context_line":"        if power_on:"},{"line_number":1342,"context_line":"            self._power_on(instance)"},{"line_number":1343,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1344,"context_line":"                                       step\u003d4,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2Qg%3D","line":1341,"in_reply_to":"AAAAWH%2F%2B3VQ%3D","updated":"2014-03-23 08:28:21.000000000","message":"ditto","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"4eb7b232be697b935f6a871500a49be2fa04b4de","unresolved":false,"context_lines":[{"line_number":1338,"context_line":"                                            spec\u003dvm_resize_spec)"},{"line_number":1339,"context_line":""},{"line_number":1340,"context_line":"        # 4. Start VM"},{"line_number":1341,"context_line":"        if power_on:"},{"line_number":1342,"context_line":"            self._power_on(instance)"},{"line_number":1343,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1344,"context_line":"                                       step\u003d4,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAWH%2F%2B2VY%3D","line":1341,"in_reply_to":"AAAAWH%2F%2B3VQ%3D","updated":"2014-03-24 00:54:25.000000000","message":"the get_vm_ref call will yield the right VM since all the 3 methods responsible for any linkage changes clone_vmref_for_instance, associate_vmref_for_instance, disassociate_vmref_for_instance method invalidates the cache as well. Thus this call will be forced to go though the vCenter server yielding the correct result","commit_id":"389cbbfe7f3b882a858b462691c7b35b1685338d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"d04306e2e4f1beaacebe4bd6b7b71b50d2b5537e","unresolved":false,"context_lines":[{"line_number":1275,"context_line":"        # 2. Disassociate the linked vsphere VM from the instance"},{"line_number":1276,"context_line":"        vm_util.disassociate_vmref_from_instance(self._session, instance,"},{"line_number":1277,"context_line":"                                                  vm_ref,"},{"line_number":1278,"context_line":"                                                  suffix\u003dself._migrate_suffix)"},{"line_number":1279,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1280,"context_line":"                                       step\u003d2,"},{"line_number":1281,"context_line":"                                       total_steps\u003dRESIZE_TOTAL_STEPS)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2Bo68%3D","line":1278,"updated":"2014-03-25 14:30:20.000000000","message":"What happens to the VM if Nova fails here? AFAICT, from a restarted Nova\u0027s POV it\u0027s just gone.\n\nI think we need either some persistent state in Nova, or we could look at the order we do things in. This might work better if we cloned the VM, resized the clone, then renamed it in confirm.\n\nHmm, no, that would still leave a failure window. Although it would be shorter... Needs thought.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"b4e5e6b5b60aeac58233aed51e7cb63ca1bbdb43","unresolved":false,"context_lines":[{"line_number":1275,"context_line":"        # 2. Disassociate the linked vsphere VM from the instance"},{"line_number":1276,"context_line":"        vm_util.disassociate_vmref_from_instance(self._session, instance,"},{"line_number":1277,"context_line":"                                                  vm_ref,"},{"line_number":1278,"context_line":"                                                  suffix\u003dself._migrate_suffix)"},{"line_number":1279,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1280,"context_line":"                                       step\u003d2,"},{"line_number":1281,"context_line":"                                       total_steps\u003dRESIZE_TOTAL_STEPS)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2BnWU%3D","line":1278,"in_reply_to":"AAAAWH%2F%2Bncs%3D","updated":"2014-03-25 15:00:54.000000000","message":"It turns out that this concern is bogus, because we can still reference the VM by its predictable new uuid, which just has -orig appended. Given that the instance will be in a resize state, the api user will still be able to recover the VM by complete or revert.","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"183c4659febf87edd37bec4dca3d09704cc65b89","unresolved":false,"context_lines":[{"line_number":1275,"context_line":"        # 2. Disassociate the linked vsphere VM from the instance"},{"line_number":1276,"context_line":"        vm_util.disassociate_vmref_from_instance(self._session, instance,"},{"line_number":1277,"context_line":"                                                  vm_ref,"},{"line_number":1278,"context_line":"                                                  suffix\u003dself._migrate_suffix)"},{"line_number":1279,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1280,"context_line":"                                       step\u003d2,"},{"line_number":1281,"context_line":"                                       total_steps\u003dRESIZE_TOTAL_STEPS)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2Bncs%3D","line":1278,"in_reply_to":"AAAAWH%2F%2Bo68%3D","updated":"2014-03-25 14:53:19.000000000","message":"If the operation fails here an exception is raised and nova fails the resize. not sure what you mean?","commit_id":"415d95e9bc696d2ac6dadb1a90fcab2f24e018b8"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"05fe1222cfe9c5673e3d042519f6099e642942c8","unresolved":false,"context_lines":[{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":"    def confirm_migration(self, migration, instance, network_info):"},{"line_number":1275,"context_line":"        \"\"\"Confirms a resize, destroying the source VM.\"\"\""},{"line_number":1276,"context_line":"        # Destroy the original VM. The vm_ref need to be searched using the"},{"line_number":1277,"context_line":"        # instance[\u0027uuid\u0027] + self._migrate_suffix as the uuid. We will not"},{"line_number":1278,"context_line":"        # get the vm when searched using the instanceUuid but rather will"},{"line_number":1279,"context_line":"        # be found using the uuid buried in the extraConfig"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2Beck%3D","line":1276,"updated":"2014-03-26 15:20:40.000000000","message":"need -\u003e needs","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"e624bf0e7998708ebc2de3e5e688dbf99aa394d9","unresolved":false,"context_lines":[{"line_number":1273,"context_line":""},{"line_number":1274,"context_line":"    def confirm_migration(self, migration, instance, network_info):"},{"line_number":1275,"context_line":"        \"\"\"Confirms a resize, destroying the source VM.\"\"\""},{"line_number":1276,"context_line":"        # Destroy the original VM. The vm_ref need to be searched using the"},{"line_number":1277,"context_line":"        # instance[\u0027uuid\u0027] + self._migrate_suffix as the uuid. We will not"},{"line_number":1278,"context_line":"        # get the vm when searched using the instanceUuid but rather will"},{"line_number":1279,"context_line":"        # be found using the uuid buried in the extraConfig"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2Bcs0%3D","line":1276,"in_reply_to":"AAAAWH%2F%2Beck%3D","updated":"2014-03-26 18:02:41.000000000","message":"Done","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"25ca596d92962aca069c2f01582c08736335d2f6","unresolved":false,"context_lines":[{"line_number":1274,"context_line":"    def confirm_migration(self, migration, instance, network_info):"},{"line_number":1275,"context_line":"        \"\"\"Confirms a resize, destroying the source VM.\"\"\""},{"line_number":1276,"context_line":"        # Destroy the original VM. The vm_ref need to be searched using the"},{"line_number":1277,"context_line":"        # instance[\u0027uuid\u0027] + self._migrate_suffix as the uuid. We will not"},{"line_number":1278,"context_line":"        # get the vm when searched using the instanceUuid but rather will"},{"line_number":1279,"context_line":"        # be found using the uuid buried in the extraConfig"},{"line_number":1280,"context_line":"        vm_ref \u003d vm_util.search_vm_ref_by_identifier(self._session,"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2Bgyo%3D","line":1277,"updated":"2014-03-26 12:03:59.000000000","message":"s/as the uuid/as identifier/","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"e624bf0e7998708ebc2de3e5e688dbf99aa394d9","unresolved":false,"context_lines":[{"line_number":1274,"context_line":"    def confirm_migration(self, migration, instance, network_info):"},{"line_number":1275,"context_line":"        \"\"\"Confirms a resize, destroying the source VM.\"\"\""},{"line_number":1276,"context_line":"        # Destroy the original VM. The vm_ref need to be searched using the"},{"line_number":1277,"context_line":"        # instance[\u0027uuid\u0027] + self._migrate_suffix as the uuid. We will not"},{"line_number":1278,"context_line":"        # get the vm when searched using the instanceUuid but rather will"},{"line_number":1279,"context_line":"        # be found using the uuid buried in the extraConfig"},{"line_number":1280,"context_line":"        vm_ref \u003d vm_util.search_vm_ref_by_identifier(self._session,"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAWH%2F%2BctA%3D","line":1277,"in_reply_to":"AAAAWH%2F%2Bgyo%3D","updated":"2014-03-26 18:02:41.000000000","message":"Done","commit_id":"c441a3d563eb3a5e48b44c775677a111493101d4"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"54bb252b41219402b6893a376c6c867897692bb9","unresolved":false,"context_lines":[{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"        # 2. Disassociate the linked vsphere VM from the instance"},{"line_number":1256,"context_line":"        vm_util.disassociate_vmref_from_instance(self._session, instance,"},{"line_number":1257,"context_line":"                                                  vm_ref,"},{"line_number":1258,"context_line":"                                                  suffix\u003dself._migrate_suffix)"},{"line_number":1259,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1260,"context_line":"                                       step\u003d2,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQok%3D","line":1257,"updated":"2014-03-28 01:56:11.000000000","message":"Shift left one space.","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"f2813f603c6b233e6cf4603dd7cab96a95a19d2b","unresolved":false,"context_lines":[{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"        # 2. Disassociate the linked vsphere VM from the instance"},{"line_number":1256,"context_line":"        vm_util.disassociate_vmref_from_instance(self._session, instance,"},{"line_number":1257,"context_line":"                                                  vm_ref,"},{"line_number":1258,"context_line":"                                                  suffix\u003dself._migrate_suffix)"},{"line_number":1259,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1260,"context_line":"                                       step\u003d2,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQlc%3D","line":1257,"in_reply_to":"AAAAWH%2F%2BQok%3D","updated":"2014-03-28 02:06:39.000000000","message":"Done","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":8119,"name":"Eric Brown","email":"eric_wade_brown@yahoo.com","username":"ericwb"},"change_message_id":"54bb252b41219402b6893a376c6c867897692bb9","unresolved":false,"context_lines":[{"line_number":1266,"context_line":"        dc_info \u003d self.get_datacenter_ref_and_name(ds_ref)"},{"line_number":1267,"context_line":"        # 3. Clone the VM for instance"},{"line_number":1268,"context_line":"        vm_util.clone_vmref_for_instance(self._session, instance, vm_ref,"},{"line_number":1269,"context_line":"                                          host_ref, ds_ref, dc_info.vmFolder)"},{"line_number":1270,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1271,"context_line":"                                       step\u003d3,"},{"line_number":1272,"context_line":"                                       total_steps\u003dRESIZE_TOTAL_STEPS)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQog%3D","line":1269,"updated":"2014-03-28 01:56:11.000000000","message":"Shift left one space.","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"},{"author":{"_account_id":7693,"name":"Sidharth Surana","email":"ssurana@vmware.com","username":"ssurana"},"change_message_id":"f2813f603c6b233e6cf4603dd7cab96a95a19d2b","unresolved":false,"context_lines":[{"line_number":1266,"context_line":"        dc_info \u003d self.get_datacenter_ref_and_name(ds_ref)"},{"line_number":1267,"context_line":"        # 3. Clone the VM for instance"},{"line_number":1268,"context_line":"        vm_util.clone_vmref_for_instance(self._session, instance, vm_ref,"},{"line_number":1269,"context_line":"                                          host_ref, ds_ref, dc_info.vmFolder)"},{"line_number":1270,"context_line":"        self._update_instance_progress(context, instance,"},{"line_number":1271,"context_line":"                                       step\u003d3,"},{"line_number":1272,"context_line":"                                       total_steps\u003dRESIZE_TOTAL_STEPS)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAWH%2F%2BQlY%3D","line":1269,"in_reply_to":"AAAAWH%2F%2BQog%3D","updated":"2014-03-28 02:06:39.000000000","message":"Done","commit_id":"45eacbdaf6b7a25f2fd71b402e5a65f1b4e38d98"}]}
