Comment 2 for bug 1549669

Revision history for this message
Lisa Li (lisali) wrote :

The two fields can't be null:
        'availability_zone': fields.StringField(),
        'attach_status': fields.StringField(),

So if they are null in db, when reading the two objects, it raises exception:

    def _from_db_object(context, volume, db_volume, expected_attrs=None):
        if expected_attrs is None:
            expected_attrs = []
        for name, field in volume.fields.items():
            if name in Volume.OPTIONAL_FIELDS:
                continue
            value = db_volume.get(name)
            if isinstance(field, fields.IntegerField):
                value = value or 0
            volume[name] = value Here it raises exception, I think we need to handle.