def unmount_snaps_directory(self) -> None:
     cmd = [
         "lxc", "config", "device", "remove", self._instance_name,
         "snapd-snaps"
     ]
     try:
         _run(cmd)
     except subprocess.CalledProcessError as process_error:
         raise _provider_errors.ProviderUnMountError(
             provider_name="lxd",
             exit_code=process_error.returncode) from process_error
Esempio n. 2
0
    def umount(self, *, mount: str) -> None:
        """Passthrough for running multipass mount.

        :param str mount: mountpoint inside the instance in the form of
                           <instance-name>:path to unmount.
        :raises errors.ProviderUMountError: when the unmount operation fails.
        """
        cmd = [self.provider_cmd, "umount", mount]
        try:
            _run(cmd)
        except subprocess.CalledProcessError as process_error:
            raise errors.ProviderUnMountError(
                provider_name=self.provider_name, exit_code=process_error.returncode
            ) from process_error