refs #1101 change "take_from"/"write_to" into "container"

pull/1/head
Natalia Serrano 2024-11-13 17:18:53 +01:00
parent 29f91cc00f
commit a19e01b078
1 changed files with 39 additions and 39 deletions

View File

@ -188,23 +188,23 @@ def ogUcastReceiverPartition (disk, par, sess, tool, level):
#ogUcastSendFile ([str_REPOSITORY] [int_ndisk int_npart] /Relative_path_file sesionMcast(puerto:ip:ip:ip)" \ #ogUcastSendFile ([str_REPOSITORY] [int_ndisk int_npart] /Relative_path_file sesionMcast(puerto:ip:ip:ip)" \
#ogUcastSendFile (disk=1, par=1, file='/aula1/winxp.img', sess='8000:172.17.36.11:172.17.36.12') #ogUcastSendFile (disk=1, par=1, file='/aula1/winxp.img', sess='8000:172.17.36.11:172.17.36.12')
#ogUcastSendFile (take_from='REPO', file='/aula1/ubuntu.iso', sess='sesionUcast') #ogUcastSendFile (container='REPO', file='/aula1/ubuntu.iso', sess='sesionUcast')
#ogUcastSendFile (take_from='CACHE', file='/aula1/winxp.img', sess='sesionUcast') #ogUcastSendFile (container='CACHE', file='/aula1/winxp.img', sess='sesionUcast')
#ogUcastSendFile ( file='/opt/opengnsys/images/aula1/hd500.vmx', sess='sesionUcast') #ogUcastSendFile ( file='/opt/opengnsys/images/aula1/hd500.vmx', sess='sesionUcast')
def ogUcastSendFile (disk=None, par=None, take_from=None, file=None, sess=None): def ogUcastSendFile (disk=None, par=None, container=None, file=None, sess=None):
if file is None: if file is None:
raise TypeError ('missing required argument: "file"') raise TypeError ('missing required argument: "file"')
if sess is None: if sess is None:
raise TypeError ('missing required argument: "sess"') raise TypeError ('missing required argument: "sess"')
if take_from is not None: if container is not None:
if disk is None and par is None: if disk is None and par is None:
## we were given take_from= ## we were given container=
source = FileLib.ogGetPath (src=take_from, file=file) source = FileLib.ogGetPath (src=container, file=file)
dev_err = f'{take_from} {file}' dev_err = f'{container} {file}'
print (f'ogGetPath (src=({take_from}), file=({file})) = source ({source})') print (f'ogGetPath (src=({container}), file=({file})) = source ({source})')
else: else:
raise TypeError ('argument "take_from" can be specified along neither "disk" nor "par"') raise TypeError ('argument "container" can be specified along neither "disk" nor "par"')
else: else:
if disk is not None and par is not None: if disk is not None and par is not None:
@ -459,23 +459,23 @@ def ogMcastSyntax (op, sess, file=None, device=None, tool=None, level=None):
#ogMcastSendFile [str_REPOSITORY] [int_ndisk int_npart] /Relative_path_file sesionMcast" \ #ogMcastSendFile [str_REPOSITORY] [int_ndisk int_npart] /Relative_path_file sesionMcast" \
#ogMcastSendFile (disk=1, par=1, file='/aula1/winxp.img', sess='sesionMcast') #ogMcastSendFile (disk=1, par=1, file='/aula1/winxp.img', sess='sesionMcast')
#ogMcastSendFile (take_from='REPO', file='/aula1/ubuntu.iso', sess='sesionMcast') #ogMcastSendFile (container='REPO', file='/aula1/ubuntu.iso', sess='sesionMcast')
#ogMcastSendFile (take_from='CACHE', file='/aula1/winxp.img', sess='sesionMcast') #ogMcastSendFile (container='CACHE', file='/aula1/winxp.img', sess='sesionMcast')
#ogMcastSendFile ( file='/opt/opengnsys/images/aula1/hd500.vmx', sess='sesionMcast') #ogMcastSendFile ( file='/opt/opengnsys/images/aula1/hd500.vmx', sess='sesionMcast')
def ogMcastSendFile (disk=None, par=None, take_from=None, file=None, sess=None): def ogMcastSendFile (disk=None, par=None, container=None, file=None, sess=None):
if file is None: if file is None:
raise TypeError ('missing required argument: "file"') raise TypeError ('missing required argument: "file"')
if sess is None: if sess is None:
raise TypeError ('missing required argument: "sess"') raise TypeError ('missing required argument: "sess"')
if take_from is not None: if container is not None:
if disk is None and par is None: if disk is None and par is None:
## we were given take_from= ## we were given container=
source = FileLib.ogGetPath (src=take_from, file=file) source = FileLib.ogGetPath (src=container, file=file)
dev_err = f'{take_from} {file}' dev_err = f'{container} {file}'
print (f'ogGetPath (src=({take_from}), file=({file})) = source ({source})') print (f'ogGetPath (src=({container}), file=({file})) = source ({source})')
else: else:
raise TypeError ('argument "take_from" can be specified along neither "disk" nor "par"') raise TypeError ('argument "container" can be specified along neither "disk" nor "par"')
else: else:
if disk is not None and par is not None: if disk is not None and par is not None:
@ -526,23 +526,23 @@ def ogMcastSendFile (disk=None, par=None, take_from=None, file=None, sess=None):
# #
#ogMcastReceiverFile ([ str_portMcast] [ [Relative_path_file] | [str_REPOSITORY path_file] | [int_ndisk int_npart path_file ] ]" \ #ogMcastReceiverFile ([ str_portMcast] [ [Relative_path_file] | [str_REPOSITORY path_file] | [int_ndisk int_npart path_file ] ]" \
#ogMcastReceiverFile ( file='/PS1_PH1.img', sess='9000') #ogMcastReceiverFile ( file='/PS1_PH1.img', sess='9000')
#ogMcastReceiverFile (write_to='CACHE', file='/aula1/PS2_PH4.img', sess='9000') #ogMcastReceiverFile (container='CACHE', file='/aula1/PS2_PH4.img', sess='9000')
#ogMcastReceiverFile (disk=1, par=1, file='/isos/linux.iso', sess='9000') #ogMcastReceiverFile (disk=1, par=1, file='/isos/linux.iso', sess='9000')
def ogMcastReceiverFile (disk=None, par=None, write_to=None, file=None, sess=None): def ogMcastReceiverFile (disk=None, par=None, container=None, file=None, sess=None):
if file is None: if file is None:
raise TypeError ('missing required argument: "file"') raise TypeError ('missing required argument: "file"')
if sess is None: if sess is None:
raise TypeError ('missing required argument: "sess"') raise TypeError ('missing required argument: "sess"')
if write_to is not None: if container is not None:
if disk is None and par is None: if disk is None and par is None:
## we were given write_to= ## we were given container=
targetdir = FileLib.ogGetParentPath (src=write_to, file=file) targetdir = FileLib.ogGetParentPath (src=container, file=file)
dev_err = f'{write_to} {file}' dev_err = f'{container} {file}'
print (f'ogGetParentPath (src=({write_to}), file=({file})) = targetdir ({targetdir})') print (f'ogGetParentPath (src=({container}), file=({file})) = targetdir ({targetdir})')
else: else:
raise TypeError ('argument "write_to" can be specified along neither "disk" nor "par"') raise TypeError ('argument "container" can be specified along neither "disk" nor "par"')
else: else:
if disk is not None and par is not None: if disk is not None and par is not None:
@ -674,9 +674,9 @@ def ogMcastRequest (img, proto):
#ogCreateTorrent ([str_REPOSITORY] [int_ndisk int_npart] Relative_path_file IpBttrack) #ogCreateTorrent ([str_REPOSITORY] [int_ndisk int_npart] Relative_path_file IpBttrack)
#ogCreateTorrent (disk=1, par=1, file='/aula1/winxp', ip_bttrack='10.1.15.23') #ogCreateTorrent (disk=1, par=1, file='/aula1/winxp', ip_bttrack='10.1.15.23')
#ogCreateTorrent (take_from='REPO', file='/aula1/winxp', ip_bttrack='10.1.15.45') #ogCreateTorrent (container='REPO', file='/aula1/winxp', ip_bttrack='10.1.15.45')
#ogCreateTorrent (take_from='CACHE', file='/aula1/winxp', ip_bttrack='10.1.15.45') #ogCreateTorrent (container='CACHE', file='/aula1/winxp', ip_bttrack='10.1.15.45')
def ogCreateTorrent (disk=None, par=None, take_from=None, file=None, ip_bttrack=None): def ogCreateTorrent (disk=None, par=None, container=None, file=None, ip_bttrack=None):
if file is None: if file is None:
raise TypeError ('missing required argument: "file"') raise TypeError ('missing required argument: "file"')
if ip_bttrack is None: if ip_bttrack is None:
@ -684,19 +684,19 @@ def ogCreateTorrent (disk=None, par=None, take_from=None, file=None, ip_bttrack=
from_cache = False from_cache = False
if take_from is not None: if container is not None:
if disk is None and par is None: if disk is None and par is None:
## we were given take_from= ## we were given container=
if 'CACHE' == take_from: from_cache = True if 'CACHE' == container: from_cache = True
ext = ImageLib.ogGetImageType (take_from, file) ext = ImageLib.ogGetImageType (container, file)
if ext is None: if ext is None:
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_NOTFOUND, f'{take_from} {file}') SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_NOTFOUND, f'{container} {file}')
return return
f = f'{file}.{ext}' f = f'{file}.{ext}'
source = FileLib.ogGetPath (src=take_from, file=f) source = FileLib.ogGetPath (src=container, file=f)
print (f'ogGetPath (src=({take_from}), file=({f})) = source ({source})') print (f'ogGetPath (src=({container}), file=({f})) = source ({source})')
else: else:
raise TypeError ('argument "take_from" can be specified along neither "disk" nor "par"') raise TypeError ('argument "container" can be specified along neither "disk" nor "par"')
else: else:
if disk is not None and par is not None: if disk is not None and par is not None: