diff --git a/client/lib/engine/bin/ProtocolLib.py b/client/lib/engine/bin/ProtocolLib.py index f51c6d6..4fa50b5 100644 --- a/client/lib/engine/bin/ProtocolLib.py +++ b/client/lib/engine/bin/ProtocolLib.py @@ -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 (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 (take_from='CACHE', file='/aula1/winxp.img', sess='sesionUcast') +#ogUcastSendFile (container='REPO', file='/aula1/ubuntu.iso', sess='sesionUcast') +#ogUcastSendFile (container='CACHE', file='/aula1/winxp.img', 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: raise TypeError ('missing required argument: "file"') if sess is None: 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: - ## we were given take_from= - source = FileLib.ogGetPath (src=take_from, file=file) - dev_err = f'{take_from} {file}' - print (f'ogGetPath (src=({take_from}), file=({file})) = source ({source})') + ## we were given container= + source = FileLib.ogGetPath (src=container, file=file) + dev_err = f'{container} {file}' + print (f'ogGetPath (src=({container}), file=({file})) = source ({source})') 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: 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 (disk=1, par=1, file='/aula1/winxp.img', sess='sesionMcast') -#ogMcastSendFile (take_from='REPO', file='/aula1/ubuntu.iso', sess='sesionMcast') -#ogMcastSendFile (take_from='CACHE', file='/aula1/winxp.img', sess='sesionMcast') +#ogMcastSendFile (container='REPO', file='/aula1/ubuntu.iso', sess='sesionMcast') +#ogMcastSendFile (container='CACHE', file='/aula1/winxp.img', 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: raise TypeError ('missing required argument: "file"') if sess is None: 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: - ## we were given take_from= - source = FileLib.ogGetPath (src=take_from, file=file) - dev_err = f'{take_from} {file}' - print (f'ogGetPath (src=({take_from}), file=({file})) = source ({source})') + ## we were given container= + source = FileLib.ogGetPath (src=container, file=file) + dev_err = f'{container} {file}' + print (f'ogGetPath (src=({container}), file=({file})) = source ({source})') 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: 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 ( file='/PS1_PH1.img', sess='9000') -#ogMcastReceiverFile (write_to='CACHE', file='/aula1/PS2_PH4.img', 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): +#ogMcastReceiverFile ( file='/PS1_PH1.img', sess='9000') +#ogMcastReceiverFile (container='CACHE', file='/aula1/PS2_PH4.img', sess='9000') +#ogMcastReceiverFile (disk=1, par=1, file='/isos/linux.iso', sess='9000') +def ogMcastReceiverFile (disk=None, par=None, container=None, file=None, sess=None): if file is None: raise TypeError ('missing required argument: "file"') if sess is None: 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: - ## we were given write_to= - targetdir = FileLib.ogGetParentPath (src=write_to, file=file) - dev_err = f'{write_to} {file}' - print (f'ogGetParentPath (src=({write_to}), file=({file})) = targetdir ({targetdir})') + ## we were given container= + targetdir = FileLib.ogGetParentPath (src=container, file=file) + dev_err = f'{container} {file}' + print (f'ogGetParentPath (src=({container}), file=({file})) = targetdir ({targetdir})') 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: 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 (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 (take_from='CACHE', file='/aula1/winxp', ip_bttrack='10.1.15.45') -def ogCreateTorrent (disk=None, par=None, take_from=None, file=None, ip_bttrack=None): +#ogCreateTorrent (container='REPO', 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, container=None, file=None, ip_bttrack=None): if file is None: raise TypeError ('missing required argument: "file"') 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 - if take_from is not None: + if container is not None: if disk is None and par is None: - ## we were given take_from= - if 'CACHE' == take_from: from_cache = True - ext = ImageLib.ogGetImageType (take_from, file) + ## we were given container= + if 'CACHE' == container: from_cache = True + ext = ImageLib.ogGetImageType (container, file) if ext is None: - SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_NOTFOUND, f'{take_from} {file}') + SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_NOTFOUND, f'{container} {file}') return f = f'{file}.{ext}' - source = FileLib.ogGetPath (src=take_from, file=f) - print (f'ogGetPath (src=({take_from}), file=({f})) = source ({source})') + source = FileLib.ogGetPath (src=container, file=f) + print (f'ogGetPath (src=({container}), file=({f})) = source ({source})') 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: if disk is not None and par is not None: