refactor: ZFS.receive
This commit is contained in:
+4
-3
@@ -266,13 +266,14 @@ class ZFS:
|
||||
return sender
|
||||
|
||||
@staticmethod
|
||||
# TODO pool_name --> pool: Pool
|
||||
def receive(stream: Popen[str], pool_name):
|
||||
def receive(stream: Popen[str], pool: Pool):
|
||||
# -d Discard the first element of the sent snapshot's file system name
|
||||
# -F Force a rollback of the file system to the most recent snapshot before performing the receive operation.
|
||||
# -u File system that is associated with the received stream is not mounted.
|
||||
if not isinstance(pool, Pool):
|
||||
raise TypeError("Can only receive into pools.")
|
||||
check_output(
|
||||
[config.ZFS, "receive", "-d", "-F", "-u", pool_name],
|
||||
[config.ZFS, "receive", "-d", "-F", "-u", pool.name],
|
||||
stdin=stream.stdout,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user