)]}'
{"ironic/api/controllers/v1/node.py":[{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c49cca48826b994a20c7b963c662f291d61b130d","unresolved":false,"context_lines":[{"line_number":973,"context_line":""},{"line_number":974,"context_line":"    @pecan.expose()"},{"line_number":975,"context_line":"    def _lookup(self, ident, subres, *remainder):"},{"line_number":976,"context_line":"        indent \u003d types.uuid_or_name.validate(ident)"},{"line_number":977,"context_line":"        subcon \u003d self._subcontroller_map.get(subres)"},{"line_number":978,"context_line":"        if subcon:"},{"line_number":979,"context_line":"            return subcon(ident), remainder"}],"source_content_type":"text/x-python","patch_set":9,"id":"7aa08908_dcd45948","line":976,"updated":"2016-06-17 22:35:02.000000000","message":"Is \u0027indent\u0027 supposed to \u0027ident\u0027?\n\nPEP8 is complaining that \u0027indent\u0027 is not used.","commit_id":"b770a56843b7f8c1ddb1871d464cb07e0464c133"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"1cc45220c65b89ea495c9b5f6928600ba6cb6961","unresolved":false,"context_lines":[{"line_number":973,"context_line":""},{"line_number":974,"context_line":"    @pecan.expose()"},{"line_number":975,"context_line":"    def _lookup(self, ident, subres, *remainder):"},{"line_number":976,"context_line":"        ident \u003d types.uuid_or_name.validate(ident)"},{"line_number":977,"context_line":"        subcon \u003d self._subcontroller_map.get(subres)"},{"line_number":978,"context_line":"        if subcon:"},{"line_number":979,"context_line":"            return subcon(ident), remainder"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_a72be380","line":976,"updated":"2016-06-27 10:10:45.000000000","message":"The type here should depend on microversion too, it should be either uuid_or_name or uuid.","commit_id":"ff057841b55752df493588e0c88da8d9feae2234"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"4505dd655b6d0134b8246721925c83dc30875d87","unresolved":false,"context_lines":[{"line_number":973,"context_line":""},{"line_number":974,"context_line":"    @pecan.expose()"},{"line_number":975,"context_line":"    def _lookup(self, ident, subres, *remainder):"},{"line_number":976,"context_line":"        ident \u003d types.uuid_or_name.validate(ident)"},{"line_number":977,"context_line":"        subcon \u003d self._subcontroller_map.get(subres)"},{"line_number":978,"context_line":"        if subcon:"},{"line_number":979,"context_line":"            return subcon(ident), remainder"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_47cddf64","line":976,"in_reply_to":"3aaa91ec_a72be380","updated":"2016-06-28 13:29:18.000000000","message":"That\u0027s handled further into the code by get_rpc_node, https://github.com/openstack/ironic/blob/master/ironic/api/controllers/v1/utils.py#L107\n\nThis line just replicates what the @expose.expose(..., types.uuid_or_name) used to do.","commit_id":"ff057841b55752df493588e0c88da8d9feae2234"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"d465bcaed4a605e5ba6c5339d3262930a52bdc6e","unresolved":false,"context_lines":[{"line_number":974,"context_line":"    @pecan.expose()"},{"line_number":975,"context_line":"    def _lookup(self, ident, subres, *remainder):"},{"line_number":976,"context_line":"        ident \u003d types.uuid_or_name.validate(ident)"},{"line_number":977,"context_line":"        subcon \u003d self._subcontroller_map.get(subres)"},{"line_number":978,"context_line":"        if subcon:"},{"line_number":979,"context_line":"            return subcon(ident), remainder"},{"line_number":980,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_f8384cf0","line":977,"range":{"start_line":977,"start_character":8,"end_line":977,"end_character":14},"updated":"2016-06-29 19:36:06.000000000","message":"nit: can we rename this \"subcontroller\" or something more complete instead? I think that would make the code more readable.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"d465bcaed4a605e5ba6c5339d3262930a52bdc6e","unresolved":false,"context_lines":[{"line_number":975,"context_line":"    def _lookup(self, ident, subres, *remainder):"},{"line_number":976,"context_line":"        ident \u003d types.uuid_or_name.validate(ident)"},{"line_number":977,"context_line":"        subcon \u003d self._subcontroller_map.get(subres)"},{"line_number":978,"context_line":"        if subcon:"},{"line_number":979,"context_line":"            return subcon(ident), remainder"},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    def _get_nodes_collection(self, chassis_uuid, instance_uuid, associated,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_182438c3","line":978,"updated":"2016-06-29 19:36:06.000000000","message":"What happens with the return codes if there\u0027s no subcontroller defined? Like if I did /v1/nodes/porks","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"42e54487324cb9bc7eaaec7db7443cabb37599ac","unresolved":false,"context_lines":[{"line_number":975,"context_line":"    def _lookup(self, ident, subres, *remainder):"},{"line_number":976,"context_line":"        ident \u003d types.uuid_or_name.validate(ident)"},{"line_number":977,"context_line":"        subcon \u003d self._subcontroller_map.get(subres)"},{"line_number":978,"context_line":"        if subcon:"},{"line_number":979,"context_line":"            return subcon(ident), remainder"},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    def _get_nodes_collection(self, chassis_uuid, instance_uuid, associated,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_f8e2f39e","line":978,"in_reply_to":"3aaa91ec_182438c3","updated":"2016-06-30 09:40:00.000000000","message":"If you did /v1/nodes/porks this function will not return anything, so the routing logic falls back to its built in logic, and will route it to the get_one function below.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"ed45bc45a03924b27cb59f1d616e6990dc40b6c2","unresolved":false,"context_lines":[{"line_number":975,"context_line":"    def _lookup(self, ident, subres, *remainder):"},{"line_number":976,"context_line":"        ident \u003d types.uuid_or_name.validate(ident)"},{"line_number":977,"context_line":"        subcon \u003d self._subcontroller_map.get(subres)"},{"line_number":978,"context_line":"        if subcon:"},{"line_number":979,"context_line":"            return subcon(ident), remainder"},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    def _get_nodes_collection(self, chassis_uuid, instance_uuid, associated,"}],"source_content_type":"text/x-python","patch_set":11,"id":"dada55a8_304a32ad","line":978,"in_reply_to":"3aaa91ec_f8e2f39e","updated":"2016-07-25 14:52:54.000000000","message":"Actually it\u0027s the other way around (from the docs):\n\nIn addition to being used for creating controllers dynamically, _lookup() is called as a last resort, when no other controller method matches the URL and there is no _default() method.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"ed45bc45a03924b27cb59f1d616e6990dc40b6c2","unresolved":false,"context_lines":[{"line_number":976,"context_line":"        ident \u003d types.uuid_or_name.validate(ident)"},{"line_number":977,"context_line":"        subcon \u003d self._subcontroller_map.get(subres)"},{"line_number":978,"context_line":"        if subcon:"},{"line_number":979,"context_line":"            return subcon(ident), remainder"},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    def _get_nodes_collection(self, chassis_uuid, instance_uuid, associated,"},{"line_number":982,"context_line":"                              maintenance, provision_state, marker, limit,"}],"source_content_type":"text/x-python","patch_set":11,"id":"dada55a8_53a0909f","line":979,"range":{"start_line":979,"start_character":26,"end_line":979,"end_character":31},"updated":"2016-07-25 14:52:54.000000000","message":"nit - I\u0027d prefer node_id\u003dident here, as portgroup_id will be added too to ports controller.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"}],"ironic/api/controllers/v1/port.py":[{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"911399042315b52e7f8a4476878e20b23ccaee68","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    invalid_sort_key_list \u003d [\u0027extra\u0027]"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def __init__(self, node_id\u003dNone):"},{"line_number":189,"context_line":"        self.node_id \u003d node_id"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def _get_ports_collection(self, node_ident, address, marker, limit,"},{"line_number":192,"context_line":"                              sort_key, sort_dir, resource_url\u003dNone,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_630d4fe8","line":189,"updated":"2016-06-15 14:35:50.000000000","message":"There should be a super() call here, nothing happens in base class right now but better to play safe.","commit_id":"eaa3365abc84f7aa38287c750d8bdb53a1f4ee88"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"911399042315b52e7f8a4476878e20b23ccaee68","unresolved":false,"context_lines":[{"line_number":278,"context_line":"                raise exception.NotAcceptable()"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        return self._get_ports_collection("},{"line_number":281,"context_line":"            node_uuid or node or self.node_id, address, marker, limit,"},{"line_number":282,"context_line":"            sort_key, sort_dir, fields\u003dfields)"},{"line_number":283,"context_line":""},{"line_number":284,"context_line":"    @expose.expose(PortCollection, types.uuid_or_name, types.uuid,"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_83c95b7c","line":281,"updated":"2016-06-15 14:35:50.000000000","message":"I think it should be \n\n self.node_id or node_uuid or node\n\nor even better, I think doing /nodes/node-0/ports?node\u003dnode-1 is a bug too, we can check if this happens now and throw an error. I\u0027d prefer it done in this patch as it is a pretty small change, but OK with a followup too.","commit_id":"eaa3365abc84f7aa38287c750d8bdb53a1f4ee88"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"1cc45220c65b89ea495c9b5f6928600ba6cb6961","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    invalid_sort_key_list \u003d [\u0027extra\u0027]"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def __init__(self, node_id\u003dNone):"},{"line_number":189,"context_line":"        self.node_id \u003d node_id"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def _get_ports_collection(self, node_ident, address, marker, limit,"},{"line_number":192,"context_line":"                              sort_key, sort_dir, resource_url\u003dNone,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3aaa91ec_273893d2","line":189,"updated":"2016-06-27 10:10:45.000000000","message":"Please see earlier comment re super call.","commit_id":"ff057841b55752df493588e0c88da8d9feae2234"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"d465bcaed4a605e5ba6c5339d3262930a52bdc6e","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                _(\"The sort_key value %(key)s is an invalid field for \""},{"line_number":207,"context_line":"                  \"sorting\") % {\u0027key\u0027: sort_key})"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        node_ident \u003d self.node_id or node_ident"},{"line_number":210,"context_line":"        if node_ident:"},{"line_number":211,"context_line":"            # FIXME(comstud): Since all we need is the node ID, we can"},{"line_number":212,"context_line":"            #                 make this more efficient by only querying"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_cb0bfc22","line":209,"updated":"2016-06-29 19:36:06.000000000","message":"Is it possible for both of these to be defined at the same time?","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"42e54487324cb9bc7eaaec7db7443cabb37599ac","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                _(\"The sort_key value %(key)s is an invalid field for \""},{"line_number":207,"context_line":"                  \"sorting\") % {\u0027key\u0027: sort_key})"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        node_ident \u003d self.node_id or node_ident"},{"line_number":210,"context_line":"        if node_ident:"},{"line_number":211,"context_line":"            # FIXME(comstud): Since all we need is the node ID, we can"},{"line_number":212,"context_line":"            #                 make this more efficient by only querying"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_d87bb7bc","line":209,"in_reply_to":"3aaa91ec_cb0bfc22","updated":"2016-06-30 09:40:00.000000000","message":"Technically possible if someone accessed the URL:\n\n/v1/nodes/\u003cnode uuid or name\u003e/ports?node\u003d\u003ca uuid or name\u003e\n/v1/nodes/\u003cnode uuid or name\u003e/ports?node_uuid\u003d\u003ca uuid\u003e\n\nI would remove the ability to support ?node / ?node_uuid but we can\u0027t because we need to continue to support:\n\n/v1/ports?node\u003d\u003ca uuid or name\u003e\n/v1/ports?node_uuid\u003d\u003ca uuid\u003e","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"d465bcaed4a605e5ba6c5339d3262930a52bdc6e","unresolved":false,"context_lines":[{"line_number":279,"context_line":"                not uuidutils.is_uuid_like(node)):"},{"line_number":280,"context_line":"                raise exception.NotAcceptable()"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        return self._get_ports_collection("},{"line_number":283,"context_line":"            node_uuid or node, address, marker, limit,"},{"line_number":284,"context_line":"            sort_key, sort_dir, fields\u003dfields)"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_8b53b416","line":282,"updated":"2016-06-29 19:36:06.000000000","message":"nit: this seems unrelated, isn\u0027t this the exact same call as before?","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"42e54487324cb9bc7eaaec7db7443cabb37599ac","unresolved":false,"context_lines":[{"line_number":279,"context_line":"                not uuidutils.is_uuid_like(node)):"},{"line_number":280,"context_line":"                raise exception.NotAcceptable()"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        return self._get_ports_collection("},{"line_number":283,"context_line":"            node_uuid or node, address, marker, limit,"},{"line_number":284,"context_line":"            sort_key, sort_dir, fields\u003dfields)"},{"line_number":285,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_bb6985c0","line":282,"in_reply_to":"3aaa91ec_8b53b416","updated":"2016-06-30 09:40:00.000000000","message":"Yes, these lines used to be changed in previous patch sets, so need to be reverted properly now.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"d465bcaed4a605e5ba6c5339d3262930a52bdc6e","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            raise exception.HTTPNotFound()"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        resource_url \u003d \u0027/\u0027.join([\u0027ports\u0027, \u0027detail\u0027])"},{"line_number":321,"context_line":"        return self._get_ports_collection("},{"line_number":322,"context_line":"            node_uuid or node, address, marker, limit,"},{"line_number":323,"context_line":"            sort_key, sort_dir, resource_url)"},{"line_number":324,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_cb593c37","line":321,"updated":"2016-06-29 19:36:06.000000000","message":"nit: this seems unrelated, isn\u0027t this the exact same call as before?","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"42e54487324cb9bc7eaaec7db7443cabb37599ac","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            raise exception.HTTPNotFound()"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        resource_url \u003d \u0027/\u0027.join([\u0027ports\u0027, \u0027detail\u0027])"},{"line_number":321,"context_line":"        return self._get_ports_collection("},{"line_number":322,"context_line":"            node_uuid or node, address, marker, limit,"},{"line_number":323,"context_line":"            sort_key, sort_dir, resource_url)"},{"line_number":324,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_9b6649eb","line":321,"in_reply_to":"3aaa91ec_cb593c37","updated":"2016-06-30 09:40:00.000000000","message":"Yes, these lines used to be changed in previous patch sets, so need to be reverted properly now.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"d465bcaed4a605e5ba6c5339d3262930a52bdc6e","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        :param fields: Optional, a list with a specified set of fields"},{"line_number":331,"context_line":"            of the resource to be returned."},{"line_number":332,"context_line":"        \"\"\""},{"line_number":333,"context_line":"        if self.node_id:"},{"line_number":334,"context_line":"            raise exception.OperationNotPermitted()"},{"line_number":335,"context_line":""},{"line_number":336,"context_line":"        api_utils.check_allow_specify_fields(fields)"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_0b67c4e9","line":333,"updated":"2016-06-29 19:36:06.000000000","message":"nit: I tend to prefer to be explicit about what we\u0027re checking for here, and below as well:\n\nif self.node_id is not None:\n...","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"3e231ba96324fabfa756101adad8cab60cb255ee","unresolved":false,"context_lines":[{"line_number":244,"context_line":"                _(\"The sort_key value %(key)s is an invalid field for \""},{"line_number":245,"context_line":"                  \"sorting\") % {\u0027key\u0027: sort_key})"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        node_ident \u003d self.node_id or node_ident"},{"line_number":248,"context_line":"        if node_ident:"},{"line_number":249,"context_line":"            # FIXME(comstud): Since all we need is the node ID, we can"},{"line_number":250,"context_line":"            #                 make this more efficient by only querying"}],"source_content_type":"text/x-python","patch_set":15,"id":"bacf61ea_4d87d460","line":247,"updated":"2016-08-06 00:58:38.000000000","message":"this is ambiguous - what\u0027s the difference between node_id and node_ident?\n\nit looks like the only difference is that node_id gets passed in, when this is invoked as a subresource of /v1/nodes/. However, that\u0027s really not clear -- everywhere else in the code, we use node_id to indicate the numerical (internal) INT ID of the node, and here I think it will be the UUID.","commit_id":"aa35feedac76d29b69eb55f6f7bada1436a13abd"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"3e231ba96324fabfa756101adad8cab60cb255ee","unresolved":false,"context_lines":[{"line_number":387,"context_line":"        cdict \u003d pecan.request.context.to_dict()"},{"line_number":388,"context_line":"        policy.authorize(\u0027baremetal:port:get\u0027, cdict, cdict)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"        if self.node_id:"},{"line_number":391,"context_line":"            raise exception.OperationNotPermitted()"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"        api_utils.check_allow_specify_fields(fields)"}],"source_content_type":"text/x-python","patch_set":15,"id":"bacf61ea_ad7ad074","line":390,"updated":"2016-08-06 00:58:38.000000000","message":"yea - this line isn\u0027t going to make sense, if someone reads the code later on (without the context of this patch)\n\nCould you choose a different variable name for this, so that it is self-descriptive? Eg,\n\n  if self.called_from_node_id:\n    raise ...","commit_id":"aa35feedac76d29b69eb55f6f7bada1436a13abd"},{"author":{"_account_id":11929,"name":"Michael Turek","email":"mjturek@linux.vnet.ibm.com","username":"mjturek"},"change_message_id":"51a352a55cd5aa089683f0f7d277e7cacefcdf80","unresolved":false,"context_lines":[{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    advanced_net_fields \u003d [\u0027pxe_enabled\u0027, \u0027local_link_connection\u0027]"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def __init__(self, node_id\u003dNone):"},{"line_number":227,"context_line":"        super(PortsController, self).__init__()"},{"line_number":228,"context_line":"        self.node_id_from_node \u003d node_id_from_node"},{"line_number":229,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"9ad45d7e_4eacb1ed","line":226,"range":{"start_line":226,"start_character":33,"end_line":226,"end_character":34},"updated":"2016-08-08 15:25:26.000000000","message":"whoops, fixing this","commit_id":"589879fd7b850a16d82c877d1bd0b9e971262b64"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"db525c6294ee85195e43f4d0aff2eb0d6f24062b","unresolved":false,"context_lines":[{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def __init__(self, node_id\u003dNone):"},{"line_number":227,"context_line":"        super(PortsController, self).__init__()"},{"line_number":228,"context_line":"        self.node_id_from_node \u003d node_id"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def _get_ports_collection(self, node_ident, address, marker, limit,"},{"line_number":231,"context_line":"                              sort_key, sort_dir, resource_url\u003dNone,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9ad45d7e_1b04b47c","line":228,"range":{"start_line":228,"start_character":13,"end_line":228,"end_character":30},"updated":"2016-08-08 16:47:42.000000000","message":"maybe node_id_from_node_controller then?","commit_id":"8c2ac37fec44737dfb68363874d4dc4a61b3712a"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"81f747955c5f026764b7ce9601cd2c4d4bced105","unresolved":false,"context_lines":[{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def __init__(self, node_id\u003dNone):"},{"line_number":227,"context_line":"        super(PortsController, self).__init__()"},{"line_number":228,"context_line":"        self.node_id_from_node \u003d node_id"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def _get_ports_collection(self, node_ident, address, marker, limit,"},{"line_number":231,"context_line":"                              sort_key, sort_dir, resource_url\u003dNone,"}],"source_content_type":"text/x-python","patch_set":17,"id":"3ac371cc_c1b141e3","line":228,"range":{"start_line":228,"start_character":13,"end_line":228,"end_character":30},"in_reply_to":"3ac371cc_29802246","updated":"2016-08-17 16:20:56.000000000","message":"++ that sounds good to me!","commit_id":"8c2ac37fec44737dfb68363874d4dc4a61b3712a"},{"author":{"_account_id":11929,"name":"Michael Turek","email":"mjturek@linux.vnet.ibm.com","username":"mjturek"},"change_message_id":"a7b319f51a18305be06f738c7c0079acd2a3ad65","unresolved":false,"context_lines":[{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def __init__(self, node_id\u003dNone):"},{"line_number":227,"context_line":"        super(PortsController, self).__init__()"},{"line_number":228,"context_line":"        self.node_id_from_node \u003d node_id"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def _get_ports_collection(self, node_ident, address, marker, limit,"},{"line_number":231,"context_line":"                              sort_key, sort_dir, resource_url\u003dNone,"}],"source_content_type":"text/x-python","patch_set":17,"id":"9ad45d7e_e3a7764d","line":228,"range":{"start_line":228,"start_character":13,"end_line":228,"end_character":30},"in_reply_to":"9ad45d7e_1b04b47c","updated":"2016-08-08 18:51:53.000000000","message":"yeaaah that might be a bit more understandable, but it\u0027ll be quite long.","commit_id":"8c2ac37fec44737dfb68363874d4dc4a61b3712a"},{"author":{"_account_id":13689,"name":"Hironori Shiina","email":"Hironori.Shiina@fujitsu.com","username":"shiina"},"change_message_id":"987a56df3893e3f74cef2914ea7ffb8287da59cf","unresolved":false,"context_lines":[{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def __init__(self, node_id\u003dNone):"},{"line_number":227,"context_line":"        super(PortsController, self).__init__()"},{"line_number":228,"context_line":"        self.node_id_from_node \u003d node_id"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def _get_ports_collection(self, node_ident, address, marker, limit,"},{"line_number":231,"context_line":"                              sort_key, sort_dir, resource_url\u003dNone,"}],"source_content_type":"text/x-python","patch_set":17,"id":"3ac371cc_29802246","line":228,"range":{"start_line":228,"start_character":13,"end_line":228,"end_character":30},"in_reply_to":"9ad45d7e_e3a7764d","updated":"2016-08-16 04:52:39.000000000","message":"How about parent_node_id?","commit_id":"8c2ac37fec44737dfb68363874d4dc4a61b3712a"}],"ironic/tests/unit/api/v1/test_nodes.py":[{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"d465bcaed4a605e5ba6c5339d3262930a52bdc6e","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        obj_utils.create_test_port(self.context, node_id\u003dnode.id)"},{"line_number":431,"context_line":"        # No node id specified"},{"line_number":432,"context_line":"        response \u003d self.get_json(\u0027/nodes/ports\u0027, expect_errors\u003dTrue)"},{"line_number":433,"context_line":"        self.assertEqual(http_client.NOT_FOUND, response.status_int)"},{"line_number":434,"context_line":""},{"line_number":435,"context_line":"    def test_ports_subresource_node_not_found(self):"},{"line_number":436,"context_line":"        non_existent_uuid \u003d \u0027eeeeeeee-cccc-aaaa-bbbb-cccccccccccc\u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_ab831055","line":433,"updated":"2016-06-29 19:36:06.000000000","message":"Isn\u0027t this still a bad request? Or does this mean that the route is not found? Sorry if I\u0027m unfamiliar with what the \"correct\" behavior for this is.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"42e54487324cb9bc7eaaec7db7443cabb37599ac","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        obj_utils.create_test_port(self.context, node_id\u003dnode.id)"},{"line_number":431,"context_line":"        # No node id specified"},{"line_number":432,"context_line":"        response \u003d self.get_json(\u0027/nodes/ports\u0027, expect_errors\u003dTrue)"},{"line_number":433,"context_line":"        self.assertEqual(http_client.NOT_FOUND, response.status_int)"},{"line_number":434,"context_line":""},{"line_number":435,"context_line":"    def test_ports_subresource_node_not_found(self):"},{"line_number":436,"context_line":"        non_existent_uuid \u003d \u0027eeeeeeee-cccc-aaaa-bbbb-cccccccccccc\u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_bbe865e3","line":433,"in_reply_to":"3aaa91ec_ab831055","updated":"2016-06-30 09:40:00.000000000","message":"This in now a node not found, because this is now a valid request, just the node isn\u0027t found. This test is testing if the id is missing from this URL:\n\n/v1/nodes/\u003cid\u003e/ports\n\nso it becomes:\n\n/v1/nodes/ports\n\nbecause we\u0027ve fixed the URL parsing/routing \"ports\" now gets interpreted as the node name, therefore returns Not found because we don\u0027t create a node with that name in the test.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":13295,"name":"Mario Villaplana","email":"mario.villaplana@gmail.com","username":"mariojv"},"change_message_id":"d465bcaed4a605e5ba6c5339d3262930a52bdc6e","unresolved":false,"context_lines":[{"line_number":1787,"context_line":"        node \u003d obj_utils.create_test_node(self.context)"},{"line_number":1788,"context_line":"        response \u003d self.delete(\u0027/nodes/%s/ports\u0027 % node.uuid,"},{"line_number":1789,"context_line":"                               expect_errors\u003dTrue)"},{"line_number":1790,"context_line":"        self.assertEqual(http_client.BAD_REQUEST, response.status_int)"},{"line_number":1791,"context_line":""},{"line_number":1792,"context_line":"    @mock.patch.object(rpcapi.ConductorAPI, \u0027destroy_node\u0027)"},{"line_number":1793,"context_line":"    def test_delete_associated(self, mock_dn):"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_eb5518c2","line":1790,"updated":"2016-06-29 19:36:06.000000000","message":"Why did this change to BAD_REQUEST instead of FORBIDDEN? Shouldn\u0027t this be valid if we want to remove all ports from a node?","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"ed45bc45a03924b27cb59f1d616e6990dc40b6c2","unresolved":false,"context_lines":[{"line_number":1787,"context_line":"        node \u003d obj_utils.create_test_node(self.context)"},{"line_number":1788,"context_line":"        response \u003d self.delete(\u0027/nodes/%s/ports\u0027 % node.uuid,"},{"line_number":1789,"context_line":"                               expect_errors\u003dTrue)"},{"line_number":1790,"context_line":"        self.assertEqual(http_client.BAD_REQUEST, response.status_int)"},{"line_number":1791,"context_line":""},{"line_number":1792,"context_line":"    @mock.patch.object(rpcapi.ConductorAPI, \u0027destroy_node\u0027)"},{"line_number":1793,"context_line":"    def test_delete_associated(self, mock_dn):"}],"source_content_type":"text/x-python","patch_set":11,"id":"dada55a8_b3446c1b","line":1790,"in_reply_to":"3aaa91ec_061840d2","updated":"2016-07-25 14:52:54.000000000","message":"In this case I think a new test with FORBIDDEN return code should be added too.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"42e54487324cb9bc7eaaec7db7443cabb37599ac","unresolved":false,"context_lines":[{"line_number":1787,"context_line":"        node \u003d obj_utils.create_test_node(self.context)"},{"line_number":1788,"context_line":"        response \u003d self.delete(\u0027/nodes/%s/ports\u0027 % node.uuid,"},{"line_number":1789,"context_line":"                               expect_errors\u003dTrue)"},{"line_number":1790,"context_line":"        self.assertEqual(http_client.BAD_REQUEST, response.status_int)"},{"line_number":1791,"context_line":""},{"line_number":1792,"context_line":"    @mock.patch.object(rpcapi.ConductorAPI, \u0027destroy_node\u0027)"},{"line_number":1793,"context_line":"    def test_delete_associated(self, mock_dn):"}],"source_content_type":"text/x-python","patch_set":11,"id":"3aaa91ec_061840d2","line":1790,"in_reply_to":"3aaa91ec_eb5518c2","updated":"2016-06-30 09:40:00.000000000","message":"Deleting all the sub-resources of a particular resource is not what the DELETE http method is designed for, it designed for delete a specific resource defined in the URL. The reason this now returns a BAD_REQUEST is because we\u0027ve fixed the routing to make sure the URL parts are processed correctly. Before if you did:\n\nDELETE /node/\u003cuuid\u003e/ports\n\nit would incorrectly interpret the \u003cuuid\u003e as the port id which is why we had to add an if statement in the function to reject this request with a FORBIDDEN.\n\nNow we\u0027ve fixed the routing doing the same request results in a BAD_REQUEST because the request is missing a piece of information e.g. the port id. The only valid URL for this request is now:\n\nDELETE /node/\u003cnode uuid\u003e/ports/\u003cport uuid\u003e\n\nHowever even though all the routing is fixed now this currently still returns a FORBIDDEN in order to maintain the same functionality as the current API.","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"286adcfb8a6d4a0aae6dfb460f67fb5e85d1bb99","unresolved":false,"context_lines":[{"line_number":1787,"context_line":"        node \u003d obj_utils.create_test_node(self.context)"},{"line_number":1788,"context_line":"        response \u003d self.delete(\u0027/nodes/%s/ports\u0027 % node.uuid,"},{"line_number":1789,"context_line":"                               expect_errors\u003dTrue)"},{"line_number":1790,"context_line":"        self.assertEqual(http_client.BAD_REQUEST, response.status_int)"},{"line_number":1791,"context_line":""},{"line_number":1792,"context_line":"    @mock.patch.object(rpcapi.ConductorAPI, \u0027destroy_node\u0027)"},{"line_number":1793,"context_line":"    def test_delete_associated(self, mock_dn):"}],"source_content_type":"text/x-python","patch_set":11,"id":"dada55a8_a1825250","line":1790,"in_reply_to":"dada55a8_b3446c1b","updated":"2016-07-25 15:16:57.000000000","message":"I agree, as with the other tests above we should have 2 tests here:\n\ndef test_delete_ports_subresource_no_port_id\n    expects BAD_REQUEST\n\nand\n\ndef test_delete_ports_subresource\n    expects FORBIDDEN","commit_id":"5e5f2075b7596493e12862e172ed0476e11f6624"}]}
