refs #1101 add ogUcastSendPartition()
parent
646090da3c
commit
1e5a2b79f7
|
@ -74,10 +74,10 @@ def ogUcastSyntax (op, sess, file=None, device=None, tool=None, level=None):
|
|||
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, f'McastSession portbase {portbase}') ## || PERROR=3
|
||||
return
|
||||
|
||||
if 'SERVER' == mode:
|
||||
if 'server' == mode:
|
||||
address = ''
|
||||
for i in range (1, len (session)):
|
||||
address += f'-O {session[i]}:{portbase}'
|
||||
address += f' -O {session[i]}:{portbase}'
|
||||
else:
|
||||
address = f'{session[1]}:{portbase}'
|
||||
#print (f'nati mode ({mode}) address ({address})')
|
||||
|
@ -121,6 +121,22 @@ def ogUcastSyntax (op, sess, file=None, device=None, tool=None, level=None):
|
|||
#@todo: ogIsLocked siempre devuelve 1
|
||||
#*/ ##
|
||||
|
||||
def ogUcastSendPartition (disk, par, sess, tool, level):
|
||||
PART = DiskLib.ogDiskToDev (disk, par)
|
||||
if not PART: return None
|
||||
|
||||
FileSystemLib.ogUnmount (disk, par)
|
||||
|
||||
cmd = ogUcastSyntax ('SENDPARTITION', 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_UCASTSENDPARTITION, ' ')
|
||||
return None
|
||||
|
||||
|
||||
|
||||
#/**
|
||||
# ogUcastReceiverPartition
|
||||
|
|
Loading…
Reference in New Issue