backend/satellite_tools/satsync.py | 15 ++++++++++-----
backend/server/rhnSQL/driver_postgresql.py | 3 +++
client/tools/rhn-virtualization/rhn-virtualization.spec | 2 +-
3 files changed, 14 insertions(+), 6 deletions(-)
New commits:
commit 4641e2989175549f0e009d0ae1d4b7e6f1435f34
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed May 18 15:49:00 2011 +0200
add missing function to pg Cursor
addressing:
Traceback (most recent call last):
File "/usr/bin/spacewalk-data-fsck", line 267, in ?
exit_value += check_db_vs_disk(options)
File "/usr/bin/spacewalk-data-fsck", line 105, in check_db_vs_disk
h.close()
AttributeError: Cursor instance has no attribute 'close'
In Oracle the h has value:
<__builtin__.OracleCursor on <cx_Oracle.Connection to
spacewalk@//localhost:1521/XE>>
I'm not really sure if we should do something here, but this should be
enough for now.
diff --git a/backend/server/rhnSQL/driver_postgresql.py
b/backend/server/rhnSQL/driver_postgresql.py
index 0921468..bb8014f 100644
--- a/backend/server/rhnSQL/driver_postgresql.py
+++ b/backend/server/rhnSQL/driver_postgresql.py
@@ -314,3 +314,6 @@ class Cursor(sql_base.Cursor):
c = rhnSQL.prepare(sql)
kwargs[column_name] = data
apply(c.execute, (), kwargs)
+
+ def close(self):
+ pass
commit 3fe8370655e9dfcd8741c1ffa3c9f85df5b5519d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed May 18 14:17:14 2011 +0200
217531 - fix package count
- do not count package twice
- do not count packages, which already lays on disk
- fix remaining time - you could not multiply timedelta with float, but
we can do timedelta*100*small_number/100
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 1f101cd..7786098 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1731,7 +1731,6 @@ Please contact your RHN representative""") %
(generation, sat_cert.generation))
#count size of missing packages
for package_id, path in missing_fs_packages:
- pkg_current = pkg_current + 1
timestamp = short_package_collection.get_package_timestamp(package_id)
package = package_collection.get_package(package_id, timestamp)
total_size = total_size+package['package_size']
@@ -1739,7 +1738,8 @@ Please contact your RHN representative""") %
(generation, sat_cert.generation))
log(1, messages.package_fetch_total_size %
(self._bytes_to_fuzzy(total_size)))
- processed_size = 0
+ real_processed_size = processed_size = 0
+ real_total_size = total_size
start_time = round(time.time())
for package_id, path in missing_fs_packages:
@@ -1765,6 +1765,9 @@ Please contact your RHN representative""") %
(generation, sat_cert.generation))
checksum_type, checksum)
if errcode == 0:
# file is already there
+ # do not count this size to time estimate
+ real_total_size -= package['package_size']
+ processed_size += package['package_size']
continue
rpmManip = RpmManip(package, path)
@@ -1809,10 +1812,12 @@ Please contact your RHN representative""") %
(generation, sat_cert.generation))
# Determine downloaded size and remaining time
size = package['package_size']
- processed_size = processed_size + size
+ real_processed_size += size
+ processed_size += size
current_time = round(time.time())
- remain_time =
(datetime.timedelta(seconds=current_time-start_time))*(total_size/processed_size - 1)
-
+ # timedalta could not be multiplicated by float
+ remain_time =
(datetime.timedelta(seconds=current_time-start_time))*((real_total_size*100)/real_processed_size-100)/100
+
log(1, messages.package_fetch_remain_size_time %
(self._bytes_to_fuzzy(processed_size), self._bytes_to_fuzzy(total_size),
remain_time))
commit 94e937b38ea36e261d619fb44f3f0ef7b09c1aa0
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue May 17 16:51:41 2011 +0200
fix spelling error
diff --git a/client/tools/rhn-virtualization/rhn-virtualization.spec
b/client/tools/rhn-virtualization/rhn-virtualization.spec
index 9657469..b2d2575 100644
--- a/client/tools/rhn-virtualization/rhn-virtualization.spec
+++ b/client/tools/rhn-virtualization/rhn-virtualization.spec
@@ -3,7 +3,7 @@
%define cron_dir %{_sysconfdir}/cron.d
Name: rhn-virtualization
-Summary: RHN/Spacewalk action support for virualization
+Summary: RHN/Spacewalk action support for virtualization
Group: System Environment/Base
License: GPLv2
Show replies by date