Dear Giridhar, Could you please consider my patch for limit the used bandwidth for scp part?
The scp command provides "-l" option which can be used to limit the bandwidth. The unit is Kbits/sec, not Kbytes/sec. I'm making a patch for this. Could you please check if it is possible to included it into the dput package? Many Thanks, Paul -- PaulLiu(劉穎駿) E-mail address: [EMAIL PROTECTED]
--- dput-0.9.2.32/dput 2008-05-04 17:58:54.000000000 +0800 +++ dput-0.9.2.32/dput 2008-08-01 02:57:01.029947251 +0800 @@ -102,6 +102,7 @@ config.set('DEFAULT', 'run_dinstall', '0') config.set('DEFAULT', 'check_version', '0') config.set('DEFAULT', 'scp_compress', '0') + config.set('DEFAULT', 'scp_netlimit', '0') config.set('DEFAULT', 'default_host_main', '') config.set('DEFAULT', 'post_upload_command', '') config.set('DEFAULT', 'pre_upload_command', '') @@ -870,12 +871,16 @@ if debug and config.getboolean(host, 'scp_compress'): print "D: Setting compression for scp" scp_compress = config.getboolean(host, 'scp_compress') + if debug and config.getint(host, 'scp_netlimit'): + print "D: Setting network limit for scp: " + str(config.getint(host, 'scp_netlimit')) + " Kbits/sec" + scp_netlimit = config.getint(host, 'scp_netlimit') ssh_config_options = filter(None, map(lambda x: x.strip(), config.get (host ,'ssh_config_options').split('\n'))) if debug: print "D: ssh config options:\n "+'\n '.join(ssh_config_options) upload_methods[method](fqdn, login, incoming, \ - files_to_upload, debug, scp_compress, ssh_config_options) + files_to_upload, debug, scp_compress, scp_netlimit , \ + ssh_config_options) else: upload_methods[method](fqdn, login, incoming, \ files_to_upload, debug, 0, progress=progress) --- dput-0.9.2.32/scp.py 2008-05-02 02:56:34.000000000 +0800 +++ dput-0.9.2.32/scp.py 2008-08-01 02:58:01.925951491 +0800 @@ -2,7 +2,7 @@ import os,sys,stat,dputhelper -def upload(fqdn,login,incoming,files_to_upload,debug,compress, +def upload(fqdn,login,incoming,files_to_upload,debug,compress,netlimit, ssh_config_options=[],progress=0): files_to_fix = [] @@ -15,6 +15,9 @@ command = ['scp', '-p'] if compress: command.append('-C') + if netlimit and netlimit>0: + command.append('-l') + command.append(str(netlimit)) for anopt in ssh_config_options: command += ['-o', anopt] # TV-Note: Are these / Should these be escaped?
signature.asc
Description: OpenPGP digital signature