Lanton Hulisani Vhengani wrote:
Hi Marcel
I located the following code:
<CODE>
def rsync_it(self,from_path,to_path):
from_path = "%s:%s" % (self.host, from_path)
cmd = "rsync -avz %s %s" % (from_path, to_path)
print _("- %s") % cmd
rc = sub_process.call(cmd, shell=True)
if rc !=0:
raise CX(_("rsync failed"))
def scp_it(self,from_path,to_path):
from_path = "%s:%s" % (self.host, from_path)
cmd = "scp %s %s" % (from_path, to_path)
print _("- %s") % cmd
rc = sub_process.call(cmd, shell=True)
if rc !=0:
raise CX(_("scp failed"))
<CODE>
from /usr/lib/python2.4/site-packages/cobbler/action_replicate.py
I would like to alter it to:
<CODE>
def rsync_it(self,from_path,to_path):
from_path = "%s:%s" % (self.host, from_path)
cmd = "rsync -avz --bwlimit=KBPS %s %s" % (from_path, to_path)
print _("- %s") % cmd
rc = sub_process.call(cmd, shell=True)
if rc !=0:
raise CX(_("rsync failed"))
def scp_it(self,from_path,to_path):
from_path = "%s:%s" % (self.host, from_path)
cmd = "scp -l KBPS %s %s" % (from_path, to_path)
print _("- %s") % cmd
rc = sub_process.call(cmd, shell=True)
if rc !=0:
raise CX(_("scp failed"))
<CODE>
Is this advisable? But does address my problem.
Regards
Lanton
Longer term I'd think we'd rather add --rsync-flags to "cobbler repo
add" to generically solve the problem of not being able to add flags (or
at least to /etc/cobbler/settings), but there's nothing wrong with you
modifying things yourself provided it solves things for you. The next
time you update the RPM you'd have to make the change again, which is
the main drawback.
--Michael