Update patch set 6
Patch Set 6: (1 comment) Patch-set: 6 Attention: {"person_ident":"Gerrit User 28609 \u003c28609@4a232e18-c5a9-48ee-94c0-e04e7cca6543\u003e","operation":"REMOVE","reason":"\u003cGERRIT_ACCOUNT_28609\u003e replied on the change"}
This commit is contained in:
parent
6d4ee7fffd
commit
5c89c05efa
@ -171,6 +171,24 @@
|
||||
"message": "Your implementation has edge cases that produce illegal results. For example,\n\nrand_dns_name_by_size(5, 3) -\u003e nsq..\n\nYou can simplify this implementation:\n\n```python\ndef rand_dns_name_by_size(name_size, label_size\u003d63):\n \"\"\"Generates label based DNS name with limited total size\n :param name_size: maximum total size in characters\n :param label_size: the maximum number of characters to be used\n per label. Max value according the RFC is 63\n https://datatracker.ietf.org/doc/html/rfc1035#\n section-2.3.4in\n :return: DNS name\n \"\"\"\n template \u003d \u0027\u0027\n while len(template) \u003c name_size:\n remaining_length \u003d name_size - len(template)\n template +\u003d \u0027{}.\u0027.format(rand_string(min(remaining_length, label_size)))\n return template\n```",
|
||||
"revId": "6aeed0d90567408179b4ea319871b789e8d75970",
|
||||
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
|
||||
},
|
||||
{
|
||||
"unresolved": true,
|
||||
"key": {
|
||||
"uuid": "c0ddd333_da1a9d5c",
|
||||
"filename": "designate_tempest_plugin/data_utils.py",
|
||||
"patchSetId": 5
|
||||
},
|
||||
"lineNbr": 70,
|
||||
"author": {
|
||||
"id": 28609
|
||||
},
|
||||
"writtenOn": "2023-07-23T14:44:31Z",
|
||||
"side": 1,
|
||||
"message": "Yep, this code is much more simple, I just added:\n1) \"-1\" here: min(remaining_length - 1, label_size)))to discount the dot.\n2) Raise exception. In some cases we simply cannot generate a valid DNS name, for \n example: rand_dns_name_by_size(10,2) --\u003e dp.qm.cp..\n So it will now throw the exception, asking developer changing the values.",
|
||||
"parentUuid": "5d03416a_cece9bc1",
|
||||
"revId": "6aeed0d90567408179b4ea319871b789e8d75970",
|
||||
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user