refs #1101 add ogMcastReceiverPartition()

pull/1/head
Natalia Serrano 2024-11-12 19:13:52 +01:00
parent 3ca8cb6dfe
commit f232fb8bdf
1 changed files with 17 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import ImageLib
import FileSystemLib import FileSystemLib
import StringLib import StringLib
import NetLib import NetLib
import DiskLib
#/** #/**
#@file ProtocolLib.py #@file ProtocolLib.py
@ -405,13 +406,13 @@ def ogMcastSendPartition (disk, par, sess, tool, compressor):
if not PART: return if not PART: return
FileSystemLib.ogUnmount (disk, par) FileSystemLib.ogUnmount (disk, par)
cmd = ogMcastSyntax ('SENDPARTITION', sess, PART, tool, compressor) cmd = ogMcastSyntax ('SENDPARTITION', sess, device=PART, tool=tool, level=compressor)
if not cmd: return None if not cmd: return None
print (f'cmd ({cmd})') print (f'cmd ({cmd})')
try: try:
subprocess.run (cmd, shell=True, check=True) subprocess.run (cmd, shell=True, check=True)
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_MCASTSENDPARTITION, ' ') SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_MCASTSENDPARTITION, ' ')
return None return None
#/** #/**
@ -425,6 +426,20 @@ def ogMcastSendPartition (disk, par, sess, tool, compressor):
#@return #@return
#@exception $OG_ERR_FORMAT #@exception $OG_ERR_FORMAT
#*/ ## #*/ ##
def ogMcastReceiverPartition (disk, par, sess, tool, compressor):
PART = DiskLib.ogDiskToDev (disk, par)
if not PART: return
FileSystemLib.ogUnmount (disk, par)
cmd = ogMcastSyntax ('RECEIVERPARTITION', sess, device=PART, tool=tool, level=compressor)
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_MCASTRECEIVERPARTITION, ' ') ## original code has OG_ERR_MCASTSENDPARTITION
return None
#/** #/**