From d75e8a56fa43baf832f2c44b637c378ffa7971bd Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Wed, 13 Nov 2024 11:02:29 +0100 Subject: [PATCH] refs #1101 add ogUcastReceiverPartition() --- client/lib/engine/bin/ProtocolLib.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client/lib/engine/bin/ProtocolLib.py b/client/lib/engine/bin/ProtocolLib.py index 85e536c..352c7b1 100644 --- a/client/lib/engine/bin/ProtocolLib.py +++ b/client/lib/engine/bin/ProtocolLib.py @@ -144,12 +144,29 @@ def ogUcastSendPartition (disk, par, sess, tool, level): #@param 1 disk #@param 2 partition #@param 3 session unicast +#@param 4 tool image +#@param 5 tool compresor #@return #@exception OG_ERR_FORMAT #@exception OG_ERR_UCASTRECEIVERPARTITION #@note #@todo: #*/ ## +def ogUcastReceiverPartition (disk, par, sess, tool, level): + PART = DiskLib.ogDiskToDev (disk, par) + if not PART: return None + + FileSystemLib.ogUnmount (disk, par) + + cmd = ogUcastSyntax ('RECEIVERPARTITION', sess, device=PART, tool=tool, level=level) + if not cmd: return None + print (f'cmd ({cmd})') + try: + subprocess.run (cmd, shell=True, check=True) + except subprocess.CalledProcessError: + SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_UCASTRECEIVERPARTITION, ' ') + return None + #/**