glance image-tag-update, not updating a tag whose length is more than 255

Bug #1640442 reported by M V P Nitesh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
lihaijing

Bug Description

The command "glance image-tag-update <IMAGE_ID> <TAG_VALUE>" will update the tag to the give <IMAGE_ID>. If the length of the <TAG_VALUE> is more than 255 , it won't update the tag and throws the below error:

"400 Bad Request: Provided object does not match schema 'image': u'123niteshgjkdhgjfdghfdjghfdjkghjfdghsdjfghjsdfghfdjghfdjghfdjghsdfgjkshdkjsfhdgljksfdghfsdkjghfdsjkdkghdsfjghdfjkhgjkdfghjkdfghjsdfkghfdjkghdfjkghsdfkjghsdfgkljsfhdgsjkdfghfsdjkghsddjskfndjighfnidughndfjgkhfndjkbhfdnbujfhdnbuidfsdsafsfsdfsdfdsfsdfdsdfdfffsdfsdfdsfsdf' is too long: Failed validating 'maxLength' in schema['properties']['tags']['items']:: {'maxLength': 255, 'type': 'string'}: On instance['tags'][0]:: u'123niteshgjkdhgjfdghfdjghfdjkghjfdghsdjfghjsdfghfdjghfdjghfdjghsdfgjkshdkjsfhdgljksfdghfsdkjghfdsjkdkghdsfjghdfjkhgjkdfghjkdfghjsdfkghfdjkghdfjkghsdfkjghsdfgkljsfhdgsjkdfghfsdjkghsddjskfndjighfnidughndfjgkhfndjkbhfdnbujfhdnbuidfsdsafsfsdfsdfdsfsdfdsdfdfffsdfsdfdsfsdf' (HTTP 400)"

M V P Nitesh (m-nitesh)
Changed in glance:
assignee: nobody → M V P Nitesh (m-nitesh)
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

As reported in the response, the maximum length you can set the tag to is 255 characters:

 'maxLength': 255

So Glance is correctly enforcing this limit.

Changed in glance:
status: New → Invalid
Revision history for this message
M V P Nitesh (m-nitesh) wrote :

Hi Struart,
I want to through proper error message like "Tag length should be less than 256"

M V P Nitesh (m-nitesh)
Changed in glance:
status: Invalid → Opinion
Revision history for this message
M V P Nitesh (m-nitesh) wrote :

Hi Stuart ,

I just want to update the error message as "Tag length should be less than 256" and update the Cli reference of http://docs.openstack.org/cli-reference/glance.html#glance-image-tag-update-v2 for <TAG_VALUE> as
"Value of the tag. Maximum length of tag can be 255"

Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :

Hi,

To make things clearer could you update the description? The current description doesn't describe a problem: it describes expected behaviour.

Right now the error message -- which I think is clear -- is autogenerated by the code enforcing the schema. What are you proposing? I'm not sure that we want to go down a path where we're creating specific code/messages for every possible schema validation failure.

Revision history for this message
M V P Nitesh (m-nitesh) wrote :

I want to do two things
1) I want to update the description for <TAG_VALUE> as "Value of the tag. Maximum length of tag can be 255"
2) Check the length of tag before updating it , if the length of tag is less than 256 i wanted to allow the tag to be updated and if it is more than 255 i want to skip the updation and throw error as "Tag length should be less than 256"

sandeep nandal (nandal)
Changed in glance:
status: Opinion → Confirmed
lihaijing (lihaijing)
Changed in glance:
assignee: M V P Nitesh (m-nitesh) → lihaijing (lihaijing)
Changed in glance:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.