)]}'
{"doc/samples/tasks/scenarios/nova/boot-and-live-migrate.json":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c9703eda5a080c61da39164c3af2f13b5a01e928","unresolved":false,"context_lines":[{"line_number":6,"context_line":"                    \"name\": \"m1.nano\""},{"line_number":7,"context_line":"                },"},{"line_number":8,"context_line":"                \"image\": {"},{"line_number":9,"context_line":"                    \"name\": \"cirros-0.3.1-x86_64-uec\""},{"line_number":10,"context_line":"                },"},{"line_number":11,"context_line":"                \"block_migration\": false"},{"line_number":12,"context_line":"            },"}],"source_content_type":"application/json","patch_set":5,"id":"5a890539_54b394e8","line":9,"updated":"2014-11-22 22:03:18.000000000","message":"we are using now regexp here. Could you take a look pls at another samples:\n\nhttps://github.com/stackforge/rally/blob/master/doc/samples/tasks/scenarios/nova/boot-and-delete.json#L9","commit_id":"0fbafe8549599bf8ce586389c49f7098f612f6d7"}],"rally/benchmark/scenarios/nova/servers.py":[{"author":{"_account_id":7369,"name":"Sergey Skripnick","email":"sskripnick@mirantis.com","username":"redixin"},"change_message_id":"f4db1c496fc273b70c73bf3a72cf4b2132899393","unresolved":false,"context_lines":[{"line_number":234,"context_line":"    def boot_and_delete_server_on_availability_zone(self, image, flavor,"},{"line_number":235,"context_line":"                                                    zone, host, min_sleep\u003d0,"},{"line_number":236,"context_line":"                                                    max_sleep\u003d0, **kwargs):"},{"line_number":237,"context_line":"        \"\"\"Tests VM boot and delete on a specific availability-zone.\"\"\""},{"line_number":238,"context_line":"        kwargs[\u0027availability_zone\u0027] \u003d zone + \u0027:\u0027 + host"},{"line_number":239,"context_line":"        server \u003d self._boot_server("},{"line_number":240,"context_line":"            self._generate_random_name(), image, flavor, **kwargs)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_59fca272","line":237,"updated":"2014-10-15 13:48:34.000000000","message":"Why \"availability-zone\"? Always was written this without dash.","commit_id":"b6601a2c967ce67abee4388f5e448e9c96853037"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"18291ced98802f45c0c75a8b23d649d22ea644f2","unresolved":false,"context_lines":[{"line_number":235,"context_line":"                                                    zone, host, min_sleep\u003d0,"},{"line_number":236,"context_line":"                                                    max_sleep\u003d0, **kwargs):"},{"line_number":237,"context_line":"        \"\"\"Tests VM boot and delete on a specific availability-zone.\"\"\""},{"line_number":238,"context_line":"        kwargs[\u0027availability_zone\u0027] \u003d zone + \u0027:\u0027 + host"},{"line_number":239,"context_line":"        server \u003d self._boot_server("},{"line_number":240,"context_line":"            self._generate_random_name(), image, flavor, **kwargs)"},{"line_number":241,"context_line":"        self.sleep_between(min_sleep, max_sleep)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_64d150cd","line":238,"updated":"2014-10-19 01:23:00.000000000","message":"Imho, you should remove this benchmark at all. \n\nWhat is the difference of this benchmark and benchmark boot_and_delete_server() ?\n\nThat has in args: \n\n   \"availablility_zone\": \"some_zone:some_host\"\n\nThere is no difference at all..","commit_id":"b6601a2c967ce67abee4388f5e448e9c96853037"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"18291ced98802f45c0c75a8b23d649d22ea644f2","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                                                    max_sleep\u003d0, **kwargs):"},{"line_number":237,"context_line":"        \"\"\"Tests VM boot and delete on a specific availability-zone.\"\"\""},{"line_number":238,"context_line":"        kwargs[\u0027availability_zone\u0027] \u003d zone + \u0027:\u0027 + host"},{"line_number":239,"context_line":"        server \u003d self._boot_server("},{"line_number":240,"context_line":"            self._generate_random_name(), image, flavor, **kwargs)"},{"line_number":241,"context_line":"        self.sleep_between(min_sleep, max_sleep)"},{"line_number":242,"context_line":"        self._delete_server(server)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_a401783b","line":239,"updated":"2014-10-19 01:23:00.000000000","message":"We should avoid creating resources from \"admin\" at this point. It\u0027s very important because we don\u0027t have *cleanup* mechaism for such kind of resources.\n\nSo what I would prefer is to: \n\n  1) Make only boot_and_live_migrate_server in this patch set (that can be merged)\n\n  2) Continue working on *cleanup* refactoring https://review.openstack.org/#/c/129060/ That as a result will allow us to cleanup admin resources as well \n\n  3) After we finish point, refactor nova benchmarks or even whole Rally framework, to allow to pass \"use_admin\" argument, that will perfrom all actions from Admin. So we won\u0027t need to duplicate all benchmarks","commit_id":"b6601a2c967ce67abee4388f5e448e9c96853037"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"18291ced98802f45c0c75a8b23d649d22ea644f2","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    def boot_and_live_migrate_server(self, image, flavor,"},{"line_number":251,"context_line":"                                     zone, host, target_host, **kwargs):"},{"line_number":252,"context_line":"        \"\"\"Tests live migration.\"\"\""},{"line_number":253,"context_line":"        kwargs[\u0027availability_zone\u0027] \u003d zone + \u0027:\u0027 + host"},{"line_number":254,"context_line":"        server \u003d self._boot_server(self._generate_random_name(),"},{"line_number":255,"context_line":"                                   image, flavor, **kwargs)"},{"line_number":256,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_a4da58e7","line":253,"updated":"2014-10-19 01:23:00.000000000","message":"I still don\u0027t think that you have to specify avaliablity_zone to do liva_migrate operation: \n\nhttp://docs.openstack.org/admin-guide-cloud/content/section_live-migration-usage.html\n\n\nAs well don\u0027t do this stuff with kwargs[\"availaiblity_zone\"] let user do this by his hand. \n\nAs well I would prefer to avoid \"target_host\" specification here. \n\nWhy not just list host from AZ that was used to _boot_server and pick some other? (This all information is available if we are using \"admin\" API)\n\n\n\nSo I prefer to see here next benchmark: \n\n    @types.set(image\u003dtypes.ImageResourceType,\n               flavor\u003dtypes.FlavorResourceType)\n    @validation.image_valid_on_flavor(\"flavor\", \"image\")\n    @validation.required_services(consts.Service.NOVA)\n    @validation.required_openstack(admin\u003dTrue, users\u003dTrue)\n    @base.scenario(context\u003d{\"cleanup\": [\"nova\"]})\n    def boot_and_live_migrate_server(self, image, flavor,\n                                     zone, host, target_host, **kwargs):\n\n        server \u003d self._boot_server(self._generate_random_name(),\n                                   image, flavor, **kwargs)\n\n        # modify _boot_server to return latest .get() result \n\n        # put all this lines in _find_host_to_migrate()\n        host \u003d getattr(server, \u0027OS-EXT-SRV-ATTR:host\u0027)\n        az \u003d getattr(s, \u0027OS-EXT-AZ:availability_zone\u0027)\n        az \u003d filter(lambda x: x.zoneName \u003d\u003d az,\n                          self.admin_client(\"nova\").availability_zones.list()[0]\n\n         new_host \u003d random.choice([for key in az.hosts if key !\u003d host])\n\n         # And finally execute this\n          self._live_migrate(server, new_host,\n\t\t\t               block_migration, disk_over_commit)\n\n\nSo we will start VM from temporary users (and do under admin only operations that requires admin access, like getting list of available hosts in AZ and migrating VM)","commit_id":"b6601a2c967ce67abee4388f5e448e9c96853037"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a8f2dfb1fbf2e4877e1cb8141be8a99d61463ca6","unresolved":false,"context_lines":[{"line_number":229,"context_line":"               flavor\u003dtypes.FlavorResourceType)"},{"line_number":230,"context_line":"    @validation.image_valid_on_flavor(\"flavor\", \"image\")"},{"line_number":231,"context_line":"    @validation.required_services(consts.Service.NOVA)"},{"line_number":232,"context_line":"    @validation.required_openstack(admin\u003dTrue)"},{"line_number":233,"context_line":"    @base.scenario(context\u003d{\"cleanup\": [\"nova\"]})"},{"line_number":234,"context_line":"    def boot_and_live_migrate_server(self, image, flavor, **kwargs):"},{"line_number":235,"context_line":"        \"\"\"Tests live migration.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_12133367","line":232,"updated":"2014-11-12 00:16:03.000000000","message":"it requires both admin and users (cause admin is used only to migrate VM, not to create/delete) \n\nso you should type here: \n\n  @validation.required_openstack(admin\u003dTrue, users\u003dTrue)","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a8f2dfb1fbf2e4877e1cb8141be8a99d61463ca6","unresolved":false,"context_lines":[{"line_number":237,"context_line":"                                   image, flavor, **kwargs)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        block_migration \u003d kwargs.get(\u0027block_migration\u0027, False)"},{"line_number":240,"context_line":"        disk_over_commit \u003d kwargs.get(\u0027disk_over_commit\u0027, False)"},{"line_number":241,"context_line":"        new_host \u003d self._find_host_to_migrate(server)"},{"line_number":242,"context_line":"        self._live_migrate(server, new_host,"},{"line_number":243,"context_line":"                           block_migration, disk_over_commit)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_7222b7ba","line":240,"updated":"2014-11-12 00:16:03.000000000","message":"I do think that this should be as well in our samples.","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c9703eda5a080c61da39164c3af2f13b5a01e928","unresolved":false,"context_lines":[{"line_number":232,"context_line":"    @validation.required_openstack(admin\u003dTrue, users\u003dTrue)"},{"line_number":233,"context_line":"    @base.scenario(context\u003d{\"cleanup\": [\"nova\"]})"},{"line_number":234,"context_line":"    def boot_and_live_migrate_server(self, image, flavor, **kwargs):"},{"line_number":235,"context_line":"        \"\"\"Tests live migration.\"\"\""},{"line_number":236,"context_line":"        server \u003d self._boot_server(self._generate_random_name(),"},{"line_number":237,"context_line":"                                   image, flavor, **kwargs)"},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_140bcc8e","line":235,"updated":"2014-11-22 22:03:18.000000000","message":"This is not enough big description. It should be more verbose. \n\nTake a look for example at Sahara benchmarks: \n\nhttps://github.com/stackforge/rally/blob/master/rally/benchmark/scenarios/sahara/clusters.py#L42-L67","commit_id":"0fbafe8549599bf8ce586389c49f7098f612f6d7"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c9703eda5a080c61da39164c3af2f13b5a01e928","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        server \u003d self._boot_server(self._generate_random_name(),"},{"line_number":237,"context_line":"                                   image, flavor, **kwargs)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        block_migration \u003d kwargs.get(\u0027block_migration\u0027, False)"},{"line_number":240,"context_line":"        disk_over_commit \u003d kwargs.get(\u0027disk_over_commit\u0027, False)"},{"line_number":241,"context_line":"        new_host \u003d self._find_host_to_migrate(server)"},{"line_number":242,"context_line":"        self._live_migrate(server, new_host,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_94cfbc55","line":239,"updated":"2014-11-22 22:03:18.000000000","message":"You should have both arguments in method signature: \n\n    def boot_and_live_migrate_server(self, image, flavor,\n                                    block_migration\u003dFalse, disk_over_commit\u003dFalse,\n                                    **kwargs):\n\n\nOtherwise line 236 doesn\u0027t work properly","commit_id":"0fbafe8549599bf8ce586389c49f7098f612f6d7"},{"author":{"_account_id":7369,"name":"Sergey Skripnick","email":"sskripnick@mirantis.com","username":"redixin"},"change_message_id":"9713cf38dba89a217b13b9ce157aef37031d8661","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    @types.set(image\u003dtypes.ImageResourceType,"},{"line_number":234,"context_line":"               flavor\u003dtypes.FlavorResourceType)"},{"line_number":235,"context_line":"    @validation.image_valid_on_flavor(\"flavor\", \"image\")"},{"line_number":236,"context_line":"    @validation.required_services(consts.Service.NOVA)"},{"line_number":237,"context_line":"    @validation.required_openstack(admin\u003dTrue, users\u003dTrue)"},{"line_number":238,"context_line":"    @base.scenario(context\u003d{\"cleanup\": [\"nova\"]})"},{"line_number":239,"context_line":"    def boot_and_live_migrate_server(self, image,"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_ed48c5b5","line":236,"updated":"2014-11-26 16:01:01.000000000","message":"Probably we should also check here if migration is available for this cloud (more then one compute node, shared storage)","commit_id":"bc80d4b544da0462a666c3d06e3dc87206dc4460"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"10ae9ac06ab413c1b9df4551a0536a90198c73e0","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    @types.set(image\u003dtypes.ImageResourceType,"},{"line_number":234,"context_line":"               flavor\u003dtypes.FlavorResourceType)"},{"line_number":235,"context_line":"    @validation.image_valid_on_flavor(\"flavor\", \"image\")"},{"line_number":236,"context_line":"    @validation.required_services(consts.Service.NOVA)"},{"line_number":237,"context_line":"    @validation.required_openstack(admin\u003dTrue, users\u003dTrue)"},{"line_number":238,"context_line":"    @base.scenario(context\u003d{\"cleanup\": [\"nova\"]})"},{"line_number":239,"context_line":"    def boot_and_live_migrate_server(self, image,"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_1cdb8122","line":236,"in_reply_to":"5a890539_50e5f2da","updated":"2014-11-26 17:39:56.000000000","message":"I was trying to find the way to do this via API. And didn\u0027t found. So I think it\u0027s okay if we not check this","commit_id":"bc80d4b544da0462a666c3d06e3dc87206dc4460"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"575a698b7137a351dd8830e595ff704ca35b188b","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    @types.set(image\u003dtypes.ImageResourceType,"},{"line_number":234,"context_line":"               flavor\u003dtypes.FlavorResourceType)"},{"line_number":235,"context_line":"    @validation.image_valid_on_flavor(\"flavor\", \"image\")"},{"line_number":236,"context_line":"    @validation.required_services(consts.Service.NOVA)"},{"line_number":237,"context_line":"    @validation.required_openstack(admin\u003dTrue, users\u003dTrue)"},{"line_number":238,"context_line":"    @base.scenario(context\u003d{\"cleanup\": [\"nova\"]})"},{"line_number":239,"context_line":"    def boot_and_live_migrate_server(self, image,"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_50e5f2da","line":236,"in_reply_to":"5a890539_ed48c5b5","updated":"2014-11-26 16:12:07.000000000","message":"How to check that?","commit_id":"bc80d4b544da0462a666c3d06e3dc87206dc4460"}],"rally/benchmark/scenarios/nova/utils.py":[{"author":{"_account_id":7369,"name":"Sergey Skripnick","email":"sskripnick@mirantis.com","username":"redixin"},"change_message_id":"f4db1c496fc273b70c73bf3a72cf4b2132899393","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                if net.label not in fip_pool:"},{"line_number":115,"context_line":"                    kwargs[\u0027nics\u0027] \u003d [{\u0027net-id\u0027: net.id}]"},{"line_number":116,"context_line":"                    break"},{"line_number":117,"context_line":"        if \u0027availability_zone\u0027 in kwargs:"},{"line_number":118,"context_line":"            server \u003d self.admin_clients(\"nova\").servers.create("},{"line_number":119,"context_line":"                server_name, image_id, flavor_id, **kwargs)"},{"line_number":120,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_1c0768cb","line":117,"updated":"2014-10-15 13:48:34.000000000","message":"Why this is necessary? Is admin permisson required in order to specify availability zone?","commit_id":"b6601a2c967ce67abee4388f5e448e9c96853037"},{"author":{"_account_id":7369,"name":"Sergey Skripnick","email":"sskripnick@mirantis.com","username":"redixin"},"change_message_id":"85bdc1122e03f98d91c8d7022787caa1a8757d4e","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                if net.label not in fip_pool:"},{"line_number":115,"context_line":"                    kwargs[\u0027nics\u0027] \u003d [{\u0027net-id\u0027: net.id}]"},{"line_number":116,"context_line":"                    break"},{"line_number":117,"context_line":"        if \u0027availability_zone\u0027 in kwargs:"},{"line_number":118,"context_line":"            server \u003d self.admin_clients(\"nova\").servers.create("},{"line_number":119,"context_line":"                server_name, image_id, flavor_id, **kwargs)"},{"line_number":120,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_c3e41b3e","line":117,"in_reply_to":"baa201ad_0d91f446","updated":"2014-10-15 16:04:32.000000000","message":"so then cleanup will not work","commit_id":"b6601a2c967ce67abee4388f5e448e9c96853037"},{"author":{"_account_id":10128,"name":"Harikrishna","email":"harikrishna.mallavolu@tcs.com","username":"Harikrishna"},"change_message_id":"afdaf19457db66099ce887c036f0e96cfe238b06","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                if net.label not in fip_pool:"},{"line_number":115,"context_line":"                    kwargs[\u0027nics\u0027] \u003d [{\u0027net-id\u0027: net.id}]"},{"line_number":116,"context_line":"                    break"},{"line_number":117,"context_line":"        if \u0027availability_zone\u0027 in kwargs:"},{"line_number":118,"context_line":"            server \u003d self.admin_clients(\"nova\").servers.create("},{"line_number":119,"context_line":"                server_name, image_id, flavor_id, **kwargs)"},{"line_number":120,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_0d91f446","line":117,"in_reply_to":"baa201ad_1c0768cb","updated":"2014-10-15 15:23:05.000000000","message":"According to the policy defined in nova admin only can create a VM on specific availability zone.\n\nand it is mentioned in policy.json line # 11\n\nhttps://github.com/openstack/nova/blob/master/etc/nova/policy.json#L11","commit_id":"b6601a2c967ce67abee4388f5e448e9c96853037"},{"author":{"_account_id":10128,"name":"Harikrishna","email":"harikrishna.mallavolu@tcs.com","username":"Harikrishna"},"change_message_id":"d4f6f78bd53d6d29cd96cb7c314e96b168fcb7de","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                if net.label not in fip_pool:"},{"line_number":115,"context_line":"                    kwargs[\u0027nics\u0027] \u003d [{\u0027net-id\u0027: net.id}]"},{"line_number":116,"context_line":"                    break"},{"line_number":117,"context_line":"        if \u0027availability_zone\u0027 in kwargs:"},{"line_number":118,"context_line":"            server \u003d self.admin_clients(\"nova\").servers.create("},{"line_number":119,"context_line":"                server_name, image_id, flavor_id, **kwargs)"},{"line_number":120,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_ae099032","line":117,"in_reply_to":"baa201ad_a3e5570a","updated":"2014-10-17 05:25:57.000000000","message":"Hi boris,\n   \nAs part of VM migration we proposed two benchmarking scenarios\n \n 1.) Launching a VM on specific availability-zone\n  \n 2.) Migrating a VM from one host to another host in the availability-zone\n\nfor launching a VM on a specific host in the availability zone needs admin privileges and admin alone can do this action,\nhaving said that it is defined in nova policy line #11, so we made the changes to the existing method _boot_server().\n\nDo you have any suggestions here.","commit_id":"b6601a2c967ce67abee4388f5e448e9c96853037"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"8b980eb792e0a2e08c40dafa1230378d42e929dd","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                if net.label not in fip_pool:"},{"line_number":115,"context_line":"                    kwargs[\u0027nics\u0027] \u003d [{\u0027net-id\u0027: net.id}]"},{"line_number":116,"context_line":"                    break"},{"line_number":117,"context_line":"        if \u0027availability_zone\u0027 in kwargs:"},{"line_number":118,"context_line":"            server \u003d self.admin_clients(\"nova\").servers.create("},{"line_number":119,"context_line":"                server_name, image_id, flavor_id, **kwargs)"},{"line_number":120,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_a3e5570a","line":117,"in_reply_to":"baa201ad_c3e41b3e","updated":"2014-10-15 16:08:21.000000000","message":"I am not sure why this is required in this patch?","commit_id":"b6601a2c967ce67abee4388f5e448e9c96853037"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a8f2dfb1fbf2e4877e1cb8141be8a99d61463ca6","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from rally.benchmark.scenarios import base"},{"line_number":22,"context_line":"from rally.benchmark import utils as bench_utils"},{"line_number":23,"context_line":"from rally import exceptions as rally_exceptions"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"nova_benchmark_opts \u003d []"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_9206431f","line":23,"updated":"2014-11-12 00:16:03.000000000","message":"why not just: \n\nfrom rally import exceptions","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a8f2dfb1fbf2e4877e1cb8141be8a99d61463ca6","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    (\u0027resize\u0027, 2, 400, 5),"},{"line_number":40,"context_line":"    (\u0027resize_confirm\u0027, 0, 200, 2),"},{"line_number":41,"context_line":"    (\u0027resize_revert\u0027, 0, 200, 2),"},{"line_number":42,"context_line":"    (\u0027live_migrate\u0027, 2, 400, 2),"},{"line_number":43,"context_line":"]"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"for action, prepoll, timeout, poll in option_names_and_defaults:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_ed040617","line":42,"updated":"2014-11-12 00:16:03.000000000","message":"I don\u0027t belive that it\u0027s possible to migrate VM for 2 seconds..","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a8f2dfb1fbf2e4877e1cb8141be8a99d61463ca6","unresolved":false,"context_lines":[{"line_number":527,"context_line":"        host \u003d getattr(server_admin, \u0027OS-EXT-SRV-ATTR:host\u0027)"},{"line_number":528,"context_line":"        az_name \u003d getattr(server_admin, \u0027OS-EXT-AZ:availability_zone\u0027)"},{"line_number":529,"context_line":"        az \u003d filter(lambda x: x.zoneName \u003d\u003d az_name,"},{"line_number":530,"context_line":"                    self.admin_clients(\"nova\").availability_zones.list())[0]"},{"line_number":531,"context_line":"        try:"},{"line_number":532,"context_line":"            new_host \u003d random.choice("},{"line_number":533,"context_line":"                          [key for key, value in az.hosts.iteritems()"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_0d21529f","line":530,"updated":"2014-11-12 00:16:03.000000000","message":"seems super strange for me....\n\n  az \u003d None\n  for a in self.admin_clients(\"nova\").availability_zones.list(): \n     if az_name \u003d\u003d a.zoneName: \n        az \u003d a\n        break","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c9703eda5a080c61da39164c3af2f13b5a01e928","unresolved":false,"context_lines":[{"line_number":499,"context_line":"                    CONF.benchmark.nova_server_resize_revert_poll_interval)"},{"line_number":500,"context_line":"        )"},{"line_number":501,"context_line":""},{"line_number":502,"context_line":"    @base.atomic_action_timer(\u0027nova.live_migrate\u0027)"},{"line_number":503,"context_line":"    def _live_migrate(self, server, target_host, block_migration\u003dFalse,"},{"line_number":504,"context_line":"                      disk_over_commit\u003dFalse, skip_host_check\u003dFalse):"},{"line_number":505,"context_line":"        server_admin \u003d self.admin_clients(\"nova\").servers.get(server.id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_54eab4ac","line":502,"updated":"2014-11-22 22:03:18.000000000","message":"Use please \" instead of \u0027 everywerhe","commit_id":"0fbafe8549599bf8ce586389c49f7098f612f6d7"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"c9703eda5a080c61da39164c3af2f13b5a01e928","unresolved":false,"context_lines":[{"line_number":522,"context_line":"                \"Migration complete but instance did not change hosts: %s\" %"},{"line_number":523,"context_line":"                host_pre_migrate)"},{"line_number":524,"context_line":""},{"line_number":525,"context_line":"    def _find_host_to_migrate(self, server):"},{"line_number":526,"context_line":"        server_admin \u003d self.admin_clients(\"nova\").servers.get(server.id)"},{"line_number":527,"context_line":"        host \u003d getattr(server_admin, \u0027OS-EXT-SRV-ATTR:host\u0027)"},{"line_number":528,"context_line":"        az_name \u003d getattr(server_admin, \u0027OS-EXT-AZ:availability_zone\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_14e4acdf","line":525,"updated":"2014-11-22 22:03:18.000000000","message":"this makes as well API calls. I think we should mark it as atomic action\n\n@base.atomic_action_timer(\"nova.find_server_to_migrate\")","commit_id":"0fbafe8549599bf8ce586389c49f7098f612f6d7"},{"author":{"_account_id":7369,"name":"Sergey Skripnick","email":"sskripnick@mirantis.com","username":"redixin"},"change_message_id":"9713cf38dba89a217b13b9ce157aef37031d8661","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        if (host_pre_migrate \u003d\u003d getattr(server_admin, \"OS-EXT-SRV-ATTR:host\")"},{"line_number":541,"context_line":"                and not skip_host_check):"},{"line_number":542,"context_line":"            raise exceptions.LiveMigrateException("},{"line_number":543,"context_line":"                \"Migration complete but instance did not change hosts: %s\" %"},{"line_number":544,"context_line":"                host_pre_migrate)"},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    @base.atomic_action_timer(\u0027nova.find_host_to_migrate\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a890539_4d42b969","line":543,"updated":"2014-11-26 16:01:01.000000000","message":"Looks like typo: \"change host\"","commit_id":"bc80d4b544da0462a666c3d06e3dc87206dc4460"}],"tests/unit/benchmark/scenarios/nova/test_servers.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a8f2dfb1fbf2e4877e1cb8141be8a99d61463ca6","unresolved":false,"context_lines":[{"line_number":321,"context_line":"        self._test_resize(confirm\u003dFalse)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def test_boot_and_live_migrate_server(self):"},{"line_number":324,"context_line":"        fake_server \u003d object()"},{"line_number":325,"context_line":"        fake_image \u003d fakes.FakeImageManager()._create()"},{"line_number":326,"context_line":"        fake_image.id \u003d \"image_id\""},{"line_number":327,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_8d4b8258","line":324,"updated":"2014-11-12 00:16:03.000000000","message":"use mocks... why do you use object()? \n\n  fake_server \u003d mock.MagicMock()","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a8f2dfb1fbf2e4877e1cb8141be8a99d61463ca6","unresolved":false,"context_lines":[{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def test_boot_and_live_migrate_server(self):"},{"line_number":324,"context_line":"        fake_server \u003d object()"},{"line_number":325,"context_line":"        fake_image \u003d fakes.FakeImageManager()._create()"},{"line_number":326,"context_line":"        fake_image.id \u003d \"image_id\""},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"        scenario \u003d servers.NovaServers()"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_adb67e3b","line":325,"updated":"2014-11-12 00:16:03.000000000","message":"You don\u0027t use fake_image anywhere. So please just remove it..","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"}],"tests/unit/benchmark/scenarios/nova/test_utils.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a8f2dfb1fbf2e4877e1cb8141be8a99d61463ca6","unresolved":false,"context_lines":[{"line_number":492,"context_line":"        self._test_atomic_action_timer(nova_scenario.atomic_actions(),"},{"line_number":493,"context_line":"                                       \u0027nova.detach_volume\u0027)"},{"line_number":494,"context_line":""},{"line_number":495,"context_line":"    def test__live_migrate_server(self):"},{"line_number":496,"context_line":"        fake_nova \u003d fakes.FakeNovaClient()"},{"line_number":497,"context_line":"        fake_nova.servers.get \u003d mock.Mock(return_value\u003dself.server)"},{"line_number":498,"context_line":"        fake_host \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_ed8de632","line":495,"updated":"2014-11-12 00:16:03.000000000","message":"don\u0027t use FakeNovaClient and such stuff, just use mock.MagicMock() here","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"a8f2dfb1fbf2e4877e1cb8141be8a99d61463ca6","unresolved":false,"context_lines":[{"line_number":516,"context_line":"                                       \u0027nova.live_migrate\u0027)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    def test__find_host_to_migrate(self):"},{"line_number":519,"context_line":"        fake_nova \u003d fakes.FakeNovaClient()"},{"line_number":520,"context_line":"        fake_nova.servers.get \u003d mock.Mock(return_value\u003dself.server)"},{"line_number":521,"context_line":"        fake_clients \u003d fakes.FakeClients()"},{"line_number":522,"context_line":"        fake_clients._nova \u003d fake_nova"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_8dad428b","line":519,"updated":"2014-11-12 00:16:03.000000000","message":"fake_clinets \u003d mock.MagicMock()\n  fake_server \u003d fake_clients().servers.get.return_value \n  setattr(fake_server, \"OS-EXT-SRV-ATTR:host\", \"b2\")\n  setattr(server_admin, \"OS-EXT-AZ:availability_zone\", \"b\")\n  \n\n  fake_clients().availability_zones.list.return_value \u003d [\n    mock.MagicMock(zoneName\u003d\"a\", hosts\u003d[\"a1\", \"a2\", \"a3\"]), \n    mock.MagicMock(zoneName\u003d\"b\", hosts\u003d[\"b1\", \"b2\", \"b3\"]), \n    mock.MagicMock(zoneName\u003d\"c\", hosts\u003d[\"c1\", \"c2\", \"c3\"]), \n  ]\n\n  fake_clients.reset_mock()\n\n  nova_scenario \u003d utils.NovaScenario(admin_clients\u003dfake_clients)\n  self.assertIn(nova_scenario._find_host_to_migrate(fake_server), \n                       [\"b1\", \"b3\"])\n\n   # do here all assertions of all fake_clients calls that should occur \n   # And that\u0027s all","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"},{"author":{"_account_id":8507,"name":"Mikhail Dubov","email":"mdubov@mirantis.com","username":"msdubov"},"change_message_id":"b330a6188475f6d6aeb64f2c1a9dfb22586cd2e6","unresolved":false,"context_lines":[{"line_number":516,"context_line":"                                       \u0027nova.live_migrate\u0027)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    def test__find_host_to_migrate(self):"},{"line_number":519,"context_line":"        fake_nova \u003d fakes.FakeNovaClient()"},{"line_number":520,"context_line":"        fake_nova.servers.get \u003d mock.Mock(return_value\u003dself.server)"},{"line_number":521,"context_line":"        fake_clients \u003d fakes.FakeClients()"},{"line_number":522,"context_line":"        fake_clients._nova \u003d fake_nova"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_d4ba8009","line":519,"in_reply_to":"5a890539_0e224c01","updated":"2014-11-19 22:52:03.000000000","message":"This works for me:\n\n    @mock.patch(NOVA_UTILS + \u0027.NovaScenario.admin_clients\u0027)\n    def test__find_host_to_migrate(self, mock_clients):\n        fake_server \u003d self.server\n        fake_host \u003d {\"nova-compute\": {\"available\": True}}\n        nova_client \u003d mock.MagicMock()\n        mock_clients.return_value \u003d nova_client\n        nova_client.servers.get.return_value \u003d fake_server\n        nova_client.availability_zones.list.return_value \u003d [\n            mock.MagicMock(zoneName\u003d\"a\",\n                           hosts\u003d{\"a1\": fake_host, \"a2\": fake_host,\n                                  \"a3\": fake_host}),\n            mock.MagicMock(zoneName\u003d\"b\",\n                           hosts\u003d{\"b1\": fake_host, \"b2\": fake_host,\n                                  \"b3\": fake_host}),\n            mock.MagicMock(zoneName\u003d\"c\",\n                           hosts\u003d{\"c1\": fake_host,\n                                  \"c2\": fake_host, \"c3\": fake_host})\n        ]\n        setattr(fake_server, \"OS-EXT-SRV-ATTR:host\", \"b2\")\n        setattr(fake_server, \"OS-EXT-AZ:availability_zone\", \"b\")\n        nova_scenario \u003d utils.NovaScenario(admin_clients\u003dfakes.FakeClients())\n        \n        self.assertIn(nova_scenario._find_host_to_migrate(fake_server),\n                                                         [\"b1\", \"b3\"])","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"},{"author":{"_account_id":10128,"name":"Harikrishna","email":"harikrishna.mallavolu@tcs.com","username":"Harikrishna"},"change_message_id":"09b05be44c707d898794ebcd82306834ea6c3d81","unresolved":false,"context_lines":[{"line_number":516,"context_line":"                                       \u0027nova.live_migrate\u0027)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    def test__find_host_to_migrate(self):"},{"line_number":519,"context_line":"        fake_nova \u003d fakes.FakeNovaClient()"},{"line_number":520,"context_line":"        fake_nova.servers.get \u003d mock.Mock(return_value\u003dself.server)"},{"line_number":521,"context_line":"        fake_clients \u003d fakes.FakeClients()"},{"line_number":522,"context_line":"        fake_clients._nova \u003d fake_nova"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_0e224c01","line":519,"in_reply_to":"5a890539_8dad428b","updated":"2014-11-19 11:22:56.000000000","message":"Hi, \nI tried with the above code, still it\u0027s failing\n\nreasons I found:\n \n  Even though we specified three zones in the return value, only one mock object is showing.\n\nThis is the code piece i tried:\n\n    @mock.patch(NOVA_UTILS + \u0027.NovaScenario.clients\u0027)\n    def test__find_host_to_migrate(self, mock_clients):\n\n        mock_clients.servers.get(return_value\u003dself.server)\n        fake_server \u003d self.server\n        setattr(fake_server, \"OS-EXT-SRV-ATTR:host\", \"b2\")\n        setattr(fake_server, \"OS-EXT-AZ:availability_zone\", \"b\")\n\n        mock_clients.availability_zones.list.return_value \u003d [\n            mock.MagicMock(zoneName\u003d\"a\", hosts\u003d[\"a1\", \"a2\", \"a3\"]),\n            mock.MagicMock(zoneName\u003d\"b\", hosts\u003d[\"b1\", \"b2\", \"b3\"]),\n            mock.MagicMock(zoneName\u003d\"c\", hosts\u003d[\"c1\", \"c2\", \"c3\"])\n        ])\n\n        nova_scenario \u003d utils.NovaScenario(admin_clients\u003dmock_clients)\n        \n        self.assertIn(nova_scenario._find_host_to_migrate(fake_server),\n                                                         [\"b1\", \"b3\"])","commit_id":"e03f508ab02c587312dff0f1313d36d645466523"}]}
