Update patch set 6

Patch Set 6: Code-Review-1

(2 comments)

Patch-set: 6
Reviewer: Gerrit User 31857 <31857@4a232e18-c5a9-48ee-94c0-e04e7cca6543>
Label: Code-Review=-1, 27e41f64e83b6ab19f79ad2c647062904fd15937
Attention: {"person_ident":"Gerrit User 31857 \u003c31857@4a232e18-c5a9-48ee-94c0-e04e7cca6543\u003e","operation":"REMOVE","reason":"\u003cGERRIT_ACCOUNT_31857\u003e replied on the change"}
This commit is contained in:
Gerrit User 31857 2024-03-12 06:44:28 +00:00 committed by Gerrit Code Review
parent 05d8a22616
commit 232445140c
2 changed files with 48 additions and 0 deletions

View File

@ -177,6 +177,30 @@
"revId": "403ccfa311b95bac7234f7d4671d6e0517da4bc9",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": false,
"key": {
"uuid": "bcda3dc5_62ea6265",
"filename": "tacker/tests/unit/policies/test_vnf_package.py",
"patchSetId": 4
},
"lineNbr": 221,
"author": {
"id": 31857
},
"writtenOn": "2024-03-12T06:44:28Z",
"side": 1,
"message": "Thanks for your update,\nAlso, I understand that it turns out that the different by implementations of the following onboarding_state branch in `upload_content` and `upload_from_uri` have different ways of testing.\n* upload_content: return probrem details [1]\n* upload_from_uri: rise exception (webob.exc.HTTPConflict) [2]\n\n[1] https://github.com/openstack/tacker/blob/stable/2023.2/tacker/api/vnfpkgm/v1/controller.py#L424-L426\n[2] https://github.com/openstack/tacker/blob/stable/2023.2/tacker/api/vnfpkgm/v1/controller.py#L511-L512",
"parentUuid": "a39727e4_4aea2905",
"range": {
"startLine": 194,
"startChar": 0,
"endLine": 221,
"endChar": 71
},
"revId": "403ccfa311b95bac7234f7d4671d6e0517da4bc9",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {

View File

@ -111,6 +111,30 @@
},
"revId": "c539e979e936eaba8d69fbcfc7601f5707c0a751",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "4afab75f_4251d468",
"filename": "tacker/tests/unit/policies/test_vnf_package.py",
"patchSetId": 5
},
"lineNbr": 244,
"author": {
"id": 31857
},
"writtenOn": "2024-03-12T06:44:28Z",
"side": 1,
"message": "\u003e It does allow to change onboarding_state\n\n**`onboarding_state`** cannot be changed in patch operation.\nI think the code is just looking at `onboarding_state` as a condition.\n* https://github.com/openstack/tacker/blob/d19541340a3e722ceb7d0606d31a59c8cdfa35b8/tacker/api/vnfpkgm/v1/controller.py#L541-L555\n\nI made the following changes and the test was successful using `common_policy_check()`. Is there any problem?\n```\n @mock.patch.object(vnf_package.VnfPackage, \"get_by_id\")\n @mock.patch.object(vnf_package.VnfPackage, \"save\")\n def test_patch_vnf_package(\n self, mock_vnf_pack_save,\n mock_vnf_by_id):\n req \u003d fake_request.HTTPRequest.blank(\n \u0027/vnf_packages/%s\u0027 % constants.UUID)\n vnf_package_obj \u003d fakes.return_vnfpkg_obj(\n vnf_package_updates\u003d{\n \u0027tenant_id\u0027: self.project_id,\n \u0027onboarding_state\u0027: \u0027CREATED\u0027,\n \"user_defined_data\": {\"testKey1\": \"val01\"}})\n mock_vnf_by_id.return_value \u003d vnf_package_obj\n body \u003d {\"operationalState\": \"ENABLED\",\n \"userDefinedData\": {\"testKey1\": \"val01\",\n \"testKey2\": \"val02\", \"testkey3\": \"val03\"}}\n rule_name \u003d policies.VNFPKGM % \u0027patch\u0027\n self.common_policy_check(self.project_member_authorized_contexts,\n self.project_member_unauthorized_contexts,\n rule_name,\n self.controller.patch,\n req, constants.UUID, body\u003dbody)\n```",
"parentUuid": "9d694ff3_1e379ad6",
"range": {
"startLine": 244,
"startChar": 61,
"endLine": 244,
"endChar": 77
},
"revId": "c539e979e936eaba8d69fbcfc7601f5707c0a751",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
}
]
}