image addition fails when the image id contains a capital letter in image.json
Bug #1732339 reported by
Venkatesh Velpula
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Juniper Openstack | Status tracked in Trunk | |||||
R4.1 |
Invalid
|
High
|
Abhay Joshi | |||
Trunk |
Invalid
|
High
|
Abhay Joshi |
Bug Description
build-id :4.1.0.0-1
build type :Official Build
DISTRO. :Ubuntu 16.04.2 LTS
SKU :newton
root@nodec21:~# server-manager add image -f image.json
{
"return_code": 8,
"return_data": null,
"return_msg": "Invalid image id. The image id cannot begin with a number, cannot contain capital letters and can contain only alphanumeric and _ characters in it"<<<<
}
root@nodec21:~# cat image.json
{
"image": [
{
"path": "/root/
"type": "contrail-
"id": "newton_R1"
}
]
}
root@nodec21:~#
Changed in juniperopenstack: | |
milestone: | none → r4.1.0.0-fcs |
To post a comment you must log in.
From the error message and the code snippet ,looks like we are intentional in doing this check for some reason but user can very much prone to give capital letters.
def is_valid_ imageid( self, image_id, image_type): "[^0-9] .*$") match(image_ id): ubuntu- package" or image_type == "contrail- centos- package" ):
pattern = re.compile( "[a-z0- 9_]*$") <<<<<<< match(image_ id):
return False
pattern = re.compile(
if not pattern.
return False
if (image_type == "contrail-
if not pattern.
return True