Check for Service disabled_reason allows strings longer than the DB field size

Bug #1583652 reported by Gorka Eguileor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Gorka Eguileor

Bug Description

Currently the checks done to see if disabled_reason is valid don't take into consideration leading and trailing spaces, so reasons with more than 255 characters will not raise an error as long as the size of the trimmed string doesn't exceed 255 characters.

Gorka Eguileor (gorka)
Changed in cinder:
assignee: nobody → Gorka Eguileor (gorka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/318744

Changed in cinder:
status: New → In Progress
Eric Harney (eharney)
Changed in cinder:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/318744
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=8a3d11cacd3043266da7a6c11f46611a30fdeee0
Submitter: Jenkins
Branch: master

commit 8a3d11cacd3043266da7a6c11f46611a30fdeee0
Author: Gorka Eguileor <email address hidden>
Date: Thu May 19 17:16:56 2016 +0200

    Fail on disabled_reasons with more than 255 chars

    Current code removes leading and trailing spaces when checking disabled
    reason for a service, but then stores it as non trimmed, so we could be
    trying to store in the DB a string longer than 255 characters.

    To preserve existing storing behavior this patch will store leading and
    trailing spaces as we are doing now, but will take them into
    consideration when counting maximum length.

    It will also raise an error if the reason is only comprised of spaces,
    just like we are doing now.

    Change-Id: Iee97d8786644ad02a83c902c7780055e2c075198
    Closes-Bug: #1583652

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/cinder 9.0.0.0b1

This issue was fixed in the openstack/cinder 9.0.0.0b1 development milestone.

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.