Actions
Tasks #71469
openmgr/vol: improve readability in exception handling part of remove_subvolume
% Done:
0%
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:
Description
Following elif clause is where readability can be improved -
except VolumeException as ve:
if ve.errno == -errno.EAGAIN and not force:
ve = VolumeException(ve.errno, ve.error_str + " (use --force to override)")
ret = self.volume_exception_to_retval(ve)
elif not (ve.errno == -errno.ENOENT and force):
ret = self.volume_exception_to_retval(ve)
return ret
If (ve.errno -errno.ENOENT and force) is True, ret remains initiated to its default value (which is 0) and thus zero is returned. Neither we inform user why zero is retuned in this case and checking for boolean value of not (ve.errno -errno.ENOENT and force) makes code a bit complicated.
Updated by Rishabh Dave 10 months ago
- Subject changed from mgr/vol: remove_subvolume can return zero even though exception was raised to mgr/vol: improve readability in exception handling part of remove_subvolume
- Description updated (diff)
Updated by Rishabh Dave 10 months ago
- Tracker changed from Bug to Tasks
- Regression deleted (
No) - Severity deleted (
3 - minor)
Updated by Rishabh Dave 10 months ago
- Status changed from In Progress to Fix Under Review
- Pull request ID set to 63554
Actions