diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-04-15 16:12:16 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-04-15 16:12:16 -0500 |
commit | 67eacfd6476fba491479dfb62013941d35ef3ace (patch) | |
tree | 2e21a6e508fe205cb2bc8fe387ee9f6ebab02f40 /zone_zfs | |
parent | 5025496a661b4b280ff1494111d3244ecc74d9c3 (diff) |
refactor: move create container logic to http.rs
Diffstat (limited to 'zone_zfs')
-rw-r--r-- | zone_zfs/src/snapshot.rs | 2 | ||||
-rw-r--r-- | zone_zfs/src/zfs.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/zone_zfs/src/snapshot.rs b/zone_zfs/src/snapshot.rs index 402b3b9..84db4e3 100644 --- a/zone_zfs/src/snapshot.rs +++ b/zone_zfs/src/snapshot.rs @@ -30,7 +30,7 @@ impl TryFrom<&str> for Snapshot { } impl Snapshot { - pub fn clone_new(&self, path: PathBuf) -> Result<FileSystem> { + pub fn clone_new(&self, path: String) -> Result<FileSystem> { FileSystem::builder() .dataset(&self.dataset.join(path)) .build_from(self.to_owned()) diff --git a/zone_zfs/src/zfs.rs b/zone_zfs/src/zfs.rs index 70dc98a..0eaa4eb 100644 --- a/zone_zfs/src/zfs.rs +++ b/zone_zfs/src/zfs.rs @@ -21,11 +21,12 @@ impl ZFS { } #[cfg(feature = "chrono")] - pub fn clone_from_latest(&self, name: PathBuf, parent: PathBuf) -> Result<FileSystem> { + pub fn clone_latest(&self, name: String, parent: PathBuf) -> Result<PathBuf> { self.get_file_system(parent)? .get_latest_snapshot()? .ok_or_else(|| Error::Snapshot("No snapshot found".into()))? .clone_new(name) + .map(|fs| fs.mountpoint().into()) } pub fn get_file_systems(&self) -> Result<Vec<FileSystem>> { |