Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicaj committed Sep 17, 2024
1 parent 5e957e7 commit 2ee613e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/middlewared/middlewared/plugins/zfs_/dataset_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def mount(self, name, options):
dataset.mount()
except libzfs.ZFSException as e:
self.logger.error('Failed to mount dataset', exc_info=True)
handle_ds_not_found(e, name)
handle_ds_not_found(e.code, name)
raise CallError(f'Failed to mount dataset: {e}')

@accepts(Str('name'), Dict('options', Bool('force', default=False)))
Expand All @@ -85,7 +85,7 @@ def umount(self, name, options):
dataset.umount(force=options['force'])
except libzfs.ZFSException as e:
self.logger.error('Failed to umount dataset', exc_info=True)
handle_ds_not_found(e, name)
handle_ds_not_found(e.code, name)
raise CallError(f'Failed to umount dataset: {e}')

@accepts(
Expand All @@ -103,7 +103,7 @@ def rename(self, name, options):
dataset.rename(options['new_name'], recursive=options['recursive'])
except libzfs.ZFSException as e:
self.logger.error('Failed to rename dataset', exc_info=True)
handle_ds_not_found(e, name)
handle_ds_not_found(e.code, name)
raise CallError(f'Failed to rename dataset: {e}')

def promote(self, name):
Expand All @@ -113,7 +113,7 @@ def promote(self, name):
dataset.promote()
except libzfs.ZFSException as e:
self.logger.error('Failed to promote dataset', exc_info=True)
handle_ds_not_found(e, name)
handle_ds_not_found(e.code, name)
raise CallError(f'Failed to promote dataset: {e}')

def inherit(self, name, prop, recursive=False):
Expand All @@ -125,7 +125,7 @@ def inherit(self, name, prop, recursive=False):
raise CallError(f'Property {prop!r} not found.', errno.ENOENT)
zprop.inherit(recursive=recursive)
except libzfs.ZFSException as e:
handle_ds_not_found(e, name)
handle_ds_not_found(e.code, name)

if prop != 'mountpoint':
raise CallError(str(e))
Expand Down

0 comments on commit 2ee613e

Please sign in to comment.