diff --git a/src/middlewared/middlewared/plugins/apps/crud.py b/src/middlewared/middlewared/plugins/apps/crud.py index cb6f312e635f..3b054320187e 100644 --- a/src/middlewared/middlewared/plugins/apps/crud.py +++ b/src/middlewared/middlewared/plugins/apps/crud.py @@ -217,6 +217,7 @@ def create_internal( app_version_details = complete_app_details['versions'][version] self.middleware.call_sync('catalog.version_supported_error_check', app_version_details) + app_volume_ds_exists = bool(self.get_app_volume_ds(app_name)) # The idea is to validate the values provided first and if it passes our validation test, we # can move forward with setting up the datasets and installing the catalog item new_values = self.middleware.call_sync( @@ -226,7 +227,6 @@ def create_internal( job.set_progress(25, 'Initial Validation completed') - app_volume_ds_exists = bool(self.get_app_volume_ds(app_name)) # Now that we have completed validation for the app in question wrt values provided, # we will now perform the following steps # 1) Create relevant dir for app @@ -265,9 +265,9 @@ def remove_failed_resources(self, app_name, version, remove_ds=False): for method, args, kwargs in ( (compose_action, (app_name, version, 'down'), {'remove_orphans': True}), (shutil.rmtree, (get_installed_app_path(app_name),), {}), - ) + ( - (self.middleware.call_sync, ('zfs.dataset.delete', apps_volume_ds, {'recursive': True})), - ) if apps_volume_ds and remove_ds else (): + ) + (( + (self.middleware.call_sync, ('zfs.dataset.delete', apps_volume_ds, {'recursive': True}), {}), + ) if apps_volume_ds and remove_ds else ()): with contextlib.suppress(Exception): method(*args, **kwargs) @@ -375,4 +375,8 @@ def get_app_volume_ds(self, app_name): # This will return volume dataset of app if it exists, otherwise null apps_volume_ds = get_app_parent_volume_ds(self.middleware.call_sync('docker.config')['dataset'], app_name) with contextlib.suppress(InstanceNotFound): - return self.middleware.call_sync('pool.dataset.get_instance_quick', apps_volume_ds)['id'] + return self.middleware.call_sync( + 'zfs.dataset.get_instance', apps_volume_ds, { + 'extra': {'retrieve_children': False, 'retrieve_properties': False} + } + )['id']