consisgroup-create generates invalid UUIDs

Bug #1564074 reported by Eric Harney
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Tom Barron

Bug Description

This code appears to be faulty, because passing in a single UUID will generate a message in the log like:

$ cinder consisgroup-create --name asdf 2a73010f-1256-4231-8c08-766ea5b98338

2016-03-30 16:23:32.235 WARNING py.warnings [req-209e5f4d-7601-4d9a-bd4a-462e10e1627d d7398f21992c46d082b1dc36dd34ede9 ca59f64168dc47759d9b427798e0f94d] /usr/local/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py:325: FutureWarning: 2a73010f-1256-4231-8c08-766ea5b98338, is an invalid UUID. Using UUIDFields with invalid UUIDs is no longer supported, and will be removed in a future release. Please update your code to input valid UUIDs or accept ValueErrors for invalid UUIDs. See http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField for further details
  "for further details" % value, FutureWarning)

Note that the UUID specified has an extra comma appended to it.

http://git.openstack.org/cgit/openstack/cinder/tree/cinder/consistencygroup/api.py?id=e5791ffc1#n131

        req_volume_type_ids = ""
        for voltype in req_volume_types:
            req_volume_type_ids = (
                req_volume_type_ids + voltype.get('id') + ",")
        if len(req_volume_type_ids) == 0:
            req_volume_type_ids = None

        availability_zone = self._extract_availability_zone(availability_zone)
        kwargs = {'user_id': context.user_id,
                  'project_id': context.project_id,
                  'availability_zone': availability_zone,
                  'status': c_fields.ConsistencyGroupStatus.CREATING,
                  'name': name,
                  'description': description,
                  'volume_type_id': req_volume_type_ids}
        group = None
        try:
            group = objects.ConsistencyGroup(context=context, **kwargs)
            group.create()

Revision history for this message
Eric Harney (eharney) wrote :

We should probably fix our tests so people stop ignoring these warnings. One of many patches: https://review.openstack.org/#/c/297337/

Eric Harney (eharney)
tags: added: consistency-groups
Cao ShuFeng (caosf-fnst)
Changed in cinder:
assignee: nobody → Cao ShuFeng (caosf-fnst)
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/303815

Changed in cinder:
status: New → In Progress
Changed in cinder:
assignee: Cao ShuFeng (caosf-fnst) → Tom Barron (tpb)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Cao ShuFeng (<email address hidden>) on branch: master
Review: https://review.openstack.org/303815
Reason: Duplicate of Tom's fix :-(.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

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

commit c164613743deee612b722a6e63bed579ac0cf462
Author: Tom Barron <email address hidden>
Date: Sat Apr 2 07:33:40 2016 -0400

    fix ConsistencyGroup volume_type_id field

    Despite its name, the 'volume_type_id' field of the
    ConsistencyGroup object is not a UUIDField since the
    field holds a comma separated value style list of
    volume type ids rather than a single UUID.

    This commit modifieds the object definition of
    ConsistencyGroup to reflect the true nature of this
    field.

    Co-Authored-By: Cao Shufeng <email address hidden>

    Partial-Bug: #1564074
    Change-Id: Ie1dc4f8a765197219f0a8ca493fd2777eaac76fa

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

This appears to be fixed. Cao, can you confirm?

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Bug Assignee Expired

Unassigning due to no activity for > 6 months.

Changed in cinder:
assignee: Tom Barron (tpb) → nobody
Eric Harney (eharney)
Changed in cinder:
assignee: nobody → Tom Barron (tpb)
status: In Progress → Fix Released
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.