Fix: UnboundLocalError variable referenced before assignment
The variable used inside the try block is also used in the except
block for logging volume id which errors out to
UnboundLocalError: local variable 'add_vol_ref' referenced before
assignment.
This patch addresses the issue by using the volume id from the
for loop.
Related-Bug:
@@ -3541,7 +3541,7 @@ class VolumeManager(manager.CleanableManager,
LOG.error("Update group "
"failed to %(op)s volume-%(volume_id)s: "
"VolumeNotFound.",
- {'volume_id': add_vol_ref.id,
+ {'volume_id': add_vol,
'op': 'add' if add else 'remove'},
resource={'type': 'group',
'id': group.id})
