)]}'
{"tempest/scenario/manager.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"3af8371896cbd6267e3eb61911ccad7fa816f6ff","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                cidr\u003dstr_cidr,"},{"line_number":625,"context_line":"                ip_version\u003dip_version"},{"line_number":626,"context_line":"            )"},{"line_number":627,"context_line":"            subnet.update(**kwargs)"},{"line_number":628,"context_line":"            try:"},{"line_number":629,"context_line":"                result \u003d client.create_subnet(**subnet)"},{"line_number":630,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_2be34a34","line":627,"updated":"2015-02-03 07:23:58.000000000","message":"Till now this method fetch the CIDR from configured block. If we need to extend this by taking CIDR as input then why not skip the processing (fetching CIDR from conf and then checking their allocation to other subnet) of configured values.\n\nIf CIDR is in input kwargs then skip the configured CIDR fetching part and just take CIDR from kwargs.\n\nAlso update the doc string of this method.\n\nsomething like-\n\n        str_cidr \u003d kwargs.get(\u0027cidr\u0027, None)\n        result \u003d None\n        if str_cidr is None:\n            def cidr_in_use(cidr, tenant_id):\n                \"\"\"\n                :return True if subnet with cidr already exist in tenant\n                    False else\n                \"\"\"\n                cidr_in_use \u003d self._list_subnets(tenant_id\u003dtenant_id, cidr\u003dcidr)\n                return len(cidr_in_use) !\u003d 0\n    \n            ip_version \u003d kwargs.pop(\u0027ip_version\u0027, 4)\n    \n            if ip_version \u003d\u003d 6:\n                tenant_cidr \u003d netaddr.IPNetwork(\n                    CONF.network.tenant_network_v6_cidr)\n                num_bits \u003d CONF.network.tenant_network_v6_mask_bits\n            else:\n                tenant_cidr \u003d netaddr.IPNetwork(CONF.network.tenant_network_cidr)\n                num_bits \u003d CONF.network.tenant_network_mask_bits\n    \n            \n            # Repeatedly attempt subnet creation with sequential cidr\n            # blocks until an unallocated block is found.\n            for subnet_cidr in tenant_cidr.subnet(num_bits):\n                str_cidr \u003d str(subnet_cidr)\n                if not cidr_in_use(str_cidr, tenant_id\u003dnetwork.tenant_id):\n                    break\n        if str_cidr:\n            subnet \u003d dict(\n                name\u003ddata_utils.rand_name(namestart),\n                network_id\u003dnetwork.id,\n                tenant_id\u003dnetwork.tenant_id,\n                cidr\u003dstr_cidr,\n                ip_version\u003dip_version\n            )\n            subnet.update(**kwargs)\n\n            try:\n                result \u003d client.create_subnet(**subnet)\n            except exceptions.Conflict as e:\n                is_overlapping_cidr \u003d \u0027overlaps with another subnet\u0027 in str(e)\n                if not is_overlapping_cidr:\n                    raise","commit_id":"8e83171d2a3f1a87cd7c781886433e90284e06ea"},{"author":{"_account_id":13173,"name":"Albert vico","email":"albert.vico@midokura.com","username":"alvico"},"change_message_id":"1ced02e1ba4f719266fa2b19381d3f936fe129f8","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                cidr\u003dstr_cidr,"},{"line_number":625,"context_line":"                ip_version\u003dip_version"},{"line_number":626,"context_line":"            )"},{"line_number":627,"context_line":"            subnet.update(**kwargs)"},{"line_number":628,"context_line":"            try:"},{"line_number":629,"context_line":"                result \u003d client.create_subnet(**subnet)"},{"line_number":630,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_374e4d70","line":627,"in_reply_to":"da86d52c_2be34a34","updated":"2015-02-26 13:27:00.000000000","message":"Hmm in my opinion you are proposing a new functionality that should be discussed elsewhere, meanwhile this patch is aimed to fix a very concrete bug.","commit_id":"8e83171d2a3f1a87cd7c781886433e90284e06ea"},{"author":{"_account_id":14824,"name":"Xavi León","email":"xavi.leon@midokura.com","username":"xleon"},"change_message_id":"ad9373fe0fa25bc1f03aa5dbca96eb2cb2176ed0","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                cidr\u003dstr_cidr,"},{"line_number":625,"context_line":"                ip_version\u003dip_version"},{"line_number":626,"context_line":"            )"},{"line_number":627,"context_line":"            subnet.update(**kwargs)"},{"line_number":628,"context_line":"            try:"},{"line_number":629,"context_line":"                result \u003d client.create_subnet(**subnet)"},{"line_number":630,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_ec513a0f","line":627,"in_reply_to":"da86d52c_2be34a34","updated":"2015-02-03 15:23:24.000000000","message":"I see your point. I\u0027m hesitant to make such a change though. It hurts readbility and increases the complexity. Besides, a couple of things to consider: \n- the second if is not necessary (str_cidr will be defined by kwargs or by the subnet_cidr loop).\n- we should move out of the first if the ip_version statement to pop the ip_version from kwargs.\n\nLet\u0027s wait for other reviewers to cast their opinions and I\u0027ll consider this optimization for the next patch set if necessary.","commit_id":"8e83171d2a3f1a87cd7c781886433e90284e06ea"}]}
