fix: ZFSPath.from_string

This commit is contained in:
timeshifter
2021-11-26 13:45:22 +01:00
parent 68b432bba8
commit 73465ebab3
+4 -2
View File
@@ -88,8 +88,10 @@ class ZFSPath:
@classmethod @classmethod
def from_string(cls, string: str) -> ZFSPath: def from_string(cls, string: str) -> ZFSPath:
path, snapname = string.split("@") snapname = None
elements: list[str] = path.split("/") if "@" in string:
string, snapname = string.split("@")
elements: list[str] = string.split("/")
return ZFSPath(elements, snapname) return ZFSPath(elements, snapname)
@property @property