Update patch set 5

Patch Set 5: Code-Review-1

(19 comments)

Patch-set: 5
Reviewer: Gerrit User 30407 <30407@4a232e18-c5a9-48ee-94c0-e04e7cca6543>
Label: Code-Review=-1, 56ff79fc1aabd0e19916382f750ee4884e6b6ad3
Attention: {"person_ident":"Gerrit User 30407 \u003c30407@4a232e18-c5a9-48ee-94c0-e04e7cca6543\u003e","operation":"REMOVE","reason":"\u003cGERRIT_ACCOUNT_30407\u003e replied on the change"}
This commit is contained in:
Gerrit User 30407 2024-04-17 09:39:00 +00:00 committed by Gerrit Code Review
parent 86e4aaa9a6
commit 0d0509e28c
2 changed files with 433 additions and 0 deletions

View File

@ -146,6 +146,24 @@
"revId": "034df2fa36f64bd2a559a82ce896e79dfed5b06b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": false,
"key": {
"uuid": "a783a3b2_3baf9163",
"filename": "manila/api/v2/share_types_encryption.py",
"patchSetId": 4
},
"lineNbr": 68,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "i thought about it again, and it really doesn\u0027t need to check here. because binding encryption to share type doesn\u0027t affect the previously unencrypted share",
"parentUuid": "c295e49e_80d8b00f",
"revId": "034df2fa36f64bd2a559a82ce896e79dfed5b06b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
@ -240,6 +258,30 @@
"revId": "034df2fa36f64bd2a559a82ce896e79dfed5b06b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": false,
"key": {
"uuid": "3a40c81f_7231811f",
"filename": "manila/api/v2/share_types_encryption.py",
"patchSetId": 4
},
"lineNbr": 110,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "What you said is also a way, and I think it is OK. Add encryption information for each type based on the original share type list.",
"parentUuid": "4256488b_e7da442c",
"range": {
"startLine": 105,
"startChar": 4,
"endLine": 110,
"endChar": 41
},
"revId": "034df2fa36f64bd2a559a82ce896e79dfed5b06b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
@ -475,6 +517,30 @@
"revId": "034df2fa36f64bd2a559a82ce896e79dfed5b06b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": false,
"key": {
"uuid": "c576e424_2b960a31",
"filename": "manila/db/sqlalchemy/api.py",
"patchSetId": 4
},
"lineNbr": 5961,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "Done",
"parentUuid": "aae0a4d1_5a4f802e",
"range": {
"startLine": 5951,
"startChar": 4,
"endLine": 5961,
"endChar": 10
},
"revId": "034df2fa36f64bd2a559a82ce896e79dfed5b06b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
@ -522,6 +588,30 @@
"revId": "034df2fa36f64bd2a559a82ce896e79dfed5b06b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": false,
"key": {
"uuid": "905184eb_329fc6fb",
"filename": "manila/db/sqlalchemy/api.py",
"patchSetId": 4
},
"lineNbr": 7595,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "Done",
"parentUuid": "157ad55b_87bc2f6c",
"range": {
"startLine": 7589,
"startChar": 4,
"endLine": 7595,
"endChar": 5
},
"revId": "034df2fa36f64bd2a559a82ce896e79dfed5b06b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {

View File

@ -0,0 +1,343 @@
{
"comments": [
{
"unresolved": false,
"key": {
"uuid": "b9e1b082_08e3f7df",
"filename": "/PATCHSET_LEVEL",
"patchSetId": 5
},
"lineNbr": 0,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "hi, Kiran Pawar, i test it in my devstack env. found some problems.\ni have place comments inlines.",
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "86805c1c_5aa20163",
"filename": "manila/api/v2/router.py",
"patchSetId": 5
},
"lineNbr": 664,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "I have tested this line, it is invalid, just delete it",
"range": {
"startLine": 664,
"startChar": 23,
"endLine": 664,
"endChar": 57
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "0e4f6e18_c72e7921",
"filename": "manila/api/v2/router.py",
"patchSetId": 5
},
"lineNbr": 667,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "In general, member_name and collection_name cannot be the same. so\n\n self.resources[\"encryptions\"] \u003d (\n share_types_encryption.create_resource())\n mapper.resource(\"encryption\", \"encryptions\",\n controller\u003dself.resources[\"encryptions\"],\n parent_resource\u003ddict(member_name\u003d\"type\",\n collection_name\u003d\"types\"))",
"range": {
"startLine": 661,
"startChar": 8,
"endLine": 667,
"endChar": 70
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "8ea106fe_95e8d727",
"filename": "manila/api/v2/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 30,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "resource_name \u003d \u0027share_types_encryption\u0027",
"range": {
"startLine": 30,
"startChar": 4,
"endLine": 30,
"endChar": 32
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "4e5906aa_e9052aaa",
"filename": "manila/api/v2/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 53,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "move this function to manila/share/share_types.py\nthen we can use \nencryption \u003d share_types.get_share_type_encryption(context, type_id)\nto get encryption info.",
"range": {
"startLine": 46,
"startChar": 4,
"endLine": 53,
"endChar": 31
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "52949dbc_bc87e1e4",
"filename": "manila/api/v2/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 64,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "encryption \u003d share_types.get_share_type_encryption(context, type_id)",
"range": {
"startLine": 64,
"startChar": 7,
"endLine": 64,
"endChar": 61
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "20525948_39f635fe",
"filename": "manila/api/v2/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 91,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "encryption \u003d share_types.get_share_type_encryption(context, type_id)",
"range": {
"startLine": 91,
"startChar": 8,
"endLine": 91,
"endChar": 70
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "c820e9b5_c09667cc",
"filename": "manila/api/v2/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 112,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "GET /types/{share_type_id}/encryptions will go into def def index(self, req, type_id) function. so type_id is needed.\n\n def index(self, req, type_id):\n \"\"\"Return a share type encryption item.\"\"\"\n context \u003d req.environ[\u0027manila.context\u0027]\n self._check_type(context, type_id)\n encryption \u003d share_types.get_share_type_encryption(context, type_id)\n return {\"encryption\": encryption}\n \nin order to get share types list with encryption info. we can update the original share type list interface\n\nupdate manila/api/v2/share_types.py line 71. update def index() function:\n\n @wsgi.Controller.authorize\n def index(self, req):\n \"\"\"Returns the list of share types.\"\"\"\n\n context \u003d req.environ[\u0027manila.context\u0027]\n limited_types \u003d self._get_share_types(req)\n types_encryptions \u003d []\n add_encryptions_info \u003d (req.api_version_request \u003e\u003d\n api_version.APIVersionRequest(\"2.86\"))\n if add_encryptions_info:\n for share_type in limited_types:\n encryption \u003d share_types.get_share_type_encryption(\n context, share_type[\u0027id\u0027])\n share_type.update({\u0027encryption\u0027: encryption})\n types_encryptions.append(share_type)\n finally_types \u003d types_encryptions if types_encryptions else limited_types\n req.cache_db_share_types(finally_types)\n return self._view_builder.index(req, finally_types)\n \nthen we call GET share/v2/types return type dict will contain encryption.\n \nupdate manila/share/share_types.py Append a function at end.\n\n def get_share_type_encryption(context, type_id):\n encryption_ref \u003d db.share_type_encryption_get(context, type_id)\n encryption_specs \u003d {}\n if not encryption_ref:\n return encryption_specs\n for key, value in encryption_ref.items():\n encryption_specs[key] \u003d value\n return encryption_specs\n\nupdate manila/api/views/types.py append a function in line 88:\n\n @common.ViewBuilder.versioned_method(\"2.86\")\n def add_is_public_attr_extension_like(self, context, share_type_dict,\n share_type):\n share_type_dict[\u0027encryption\u0027] \u003d share_type.get(\u0027encryption\u0027, {})",
"range": {
"startLine": 104,
"startChar": 4,
"endLine": 112,
"endChar": 30
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "a3c5b244_afc6c120",
"filename": "manila/api/v2/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 122,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "i found if we want to use def show, it must be \ndef show(self, req, type_id, encryption_id):\nbut index function already can be used to get encryption info for a share type.\nso delete this function.",
"range": {
"startLine": 116,
"startChar": 4,
"endLine": 122,
"endChar": 0
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "cc259ffe_8757a016",
"filename": "manila/policies/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 1,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "you must add share_types_encryption to manila/policies/__init__.py\n\n from manila.policies import share_type\n from manila.policies import share_types_encryption # need add this line\n from manila.policies import share_types_extra_spec\n \nand\n\n def list_rules():\n return itertools.chain(\n base.list_rules(),\n availability_zone.list_rules(),\n scheduler_stats.list_rules(),\n shares.list_rules(),\n share_instance_export_location.list_rules(),\n share_type.list_rules(),\n share_types_encryption.list_rules(), #add this line\n share_types_extra_spec.list_rules(),",
"range": {
"startLine": 1,
"startChar": 5,
"endLine": 1,
"endChar": 24
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "0fd7a148_f160acb6",
"filename": "manila/policies/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 65,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "encryptions",
"range": {
"startLine": 65,
"startChar": 48,
"endLine": 65,
"endChar": 58
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "b882c322_97f15408",
"filename": "manila/policies/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 82,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "delete it, we no need show.",
"range": {
"startLine": 70,
"startChar": 4,
"endLine": 82,
"endChar": 6
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "76bcb2e5_ac894e35",
"filename": "manila/policies/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 91,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "/types/{share_type_id}/encryptions",
"range": {
"startLine": 91,
"startChar": 25,
"endLine": 91,
"endChar": 43
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "0a9f91db_1aa486e0",
"filename": "manila/policies/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 104,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "encryptions",
"range": {
"startLine": 104,
"startChar": 48,
"endLine": 104,
"endChar": 58
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {
"uuid": "3bb6df4c_35f99728",
"filename": "manila/policies/share_types_encryption.py",
"patchSetId": 5
},
"lineNbr": 117,
"author": {
"id": 30407
},
"writtenOn": "2024-04-17T09:39:00Z",
"side": 1,
"message": "encryptions",
"range": {
"startLine": 117,
"startChar": 48,
"endLine": 117,
"endChar": 58
},
"revId": "7173257f3c0f48a4fa763e75fd06c8f2dfcfca7b",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
}
]
}