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.
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) :
expected_ attrs = [] fields. items() : OPTIONAL_ FIELDS:
continue IntegerField) :
value = value or 0
volume[ name] = value Here it raises exception, I think we need to handle.
if expected_attrs is None:
for name, field in volume.
if name in Volume.
value = db_volume.get(name)
if isinstance(field, fields.