Changes to 'refs/tags/spacewalk-backend-0.8.7-1'
by Michael Mraka
Tag 'spacewalk-backend-0.8.7-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2009-12-10 16:08 +0000
Tagging package [spacewalk-backend] version [0.8.7-1] in directory [backend/].
Changes since spacewalk-java-0.8.2-1:
Jan Pazdziora (1):
The web_product_valid_numbers table does not exist in Spacewalk 0.7 / Satellite 5.3.
Michael Mraka (15):
fixed import of createPath
getStringChecksum needs 2 params
let's use getStringMD5 from spacewalk.common.checksum
removed dead code
removed dead code
replaced getFileMD5 with getFileChecksum
use getFileChecksum from spacewalk.common.checksum
checksum has to be tuple
use getFileChecksum from spacewalk.common.checksum
use getFileChecksum from spacewalk.common.checksum
removed dead code
replaced rhnLib.getFileMD5 with checksum.getFileChecksum
replaced rhnLib.getFileMD5 with checksum.getFileChecksum
removed dead code
Automatic commit of package [spacewalk-backend] release [0.8.7-1].
---
backend/common/rhnLib.py | 56 ----------
backend/satellite_tools/satsync.py | 38 +++---
backend/satellite_tools/syncLib.py | 46 --------
backend/satellite_tools/xmlDiskSource.py | 2
backend/server/configFilesHandler.py | 2
backend/server/handlers/app/packages.py | 7 -
backend/server/handlers/xmlrpc/registration.py | 40 -------
backend/server/importlib/headerSource.py | 7 -
backend/server/importlib/importLib.py | 8 -
backend/server/rhnPackageUpload.py | 7 -
backend/spacewalk-backend.spec | 4
backend/spacewalk/common/checksum.py | 2
backend/upload_server/handlers/package_push/package_push.py | 5
backend/upload_server/handlers/package_upload/package_upload.py | 5
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 4
rel-eng/packages/spacewalk-backend | 2
schema/spacewalk/common/tables/tables.deps | 2
spacewalk/certs-tools/sslToolLib.py | 6 -
18 files changed, 54 insertions(+), 189 deletions(-)
---
14 years, 5 months
backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 4 ++--
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 3ff2fe11169f84eb5a5bc00a1a49f8ffa649d4f3
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 17:08:31 2009 +0100
Automatic commit of package [spacewalk-backend] release [0.8.7-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 36eb6e0..65c04a1 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 0.8.6
+Version: 0.8.7
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -598,7 +598,7 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
-* Thu Dec 10 2009 Michael Mraka <michael.mraka(a)redhat.com> 0.8.6-1
+* Thu Dec 10 2009 Michael Mraka <michael.mraka(a)redhat.com> 0.8.7-1
- added support for uploading SHA256 rpms
- 541078 - rhn-satellite-exporter --start-date and --end-date issues fixed
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 29a0ed3..16bd313 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-0.8.6-1 backend/
+0.8.7-1 backend/
14 years, 5 months
9 commits - backend/common backend/satellite_tools backend/server backend/upload_server
by Michael Mraka
backend/common/rhnLib.py | 46 ----------
backend/satellite_tools/satsync.py | 35 +++----
backend/satellite_tools/syncLib.py | 46 ----------
backend/server/handlers/app/packages.py | 7 -
backend/server/importlib/headerSource.py | 7 -
backend/server/importlib/importLib.py | 8 +
backend/server/rhnPackageUpload.py | 7 -
backend/upload_server/handlers/package_push/package_push.py | 5 -
backend/upload_server/handlers/package_upload/package_upload.py | 5 -
9 files changed, 45 insertions(+), 121 deletions(-)
New commits:
commit bbff8b12d1aa3fc6723a1da7a20c1fcc89e55b45
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 17:07:37 2009 +0100
removed dead code
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index c6eca42..1ff84ee 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -369,47 +369,6 @@ def rotateFile(filepath, depth=5, suffix='.', verbosity=0):
return pathNSuffix1
-def getFileMD5(filename=None, fd=None, file=None, buffer_size=None):
- """ Compute a file's md5sum
- Used by rotateFile()
- """
- return getFileChecksum('md5', filename, fd, file, buffer_size)
-
-def getFileChecksum(hashtype, filename=None, fd=None, file=None, buffer_size=None):
- """ Compute a file's checksum
- Used by rotateFile()
- """
-
- # python's md5 lib sucks
- # there's no way to directly import a file.
- if buffer_size is None:
- buffer_size = 65536
-
- if filename is None and fd is None and file is None:
- raise ValueError("no file specified")
- if file:
- f = file
- elif fd is not None:
- f = os.fdopen(os.dup(fd), "r")
- else:
- f = open(filename, "r")
- # Rewind it
- f.seek(0, 0)
- m = hashlib.new(hashtype)
- while 1:
- buffer = f.read(buffer_size)
- if not buffer:
- break
- m.update(buffer)
-
- # cleanup time
- if file is not None:
- file.seek(0, 0)
- else:
- f.close()
- return m.hexdigest()
-
-
def rhn_popen(cmd, progressCallback=None, bufferSize=16384, outputLog=None):
""" popen-like function, that accepts execvp-style arguments too (i.e. an
array of params, thus making shell escaping unnecessary)
commit 1b5f2fb2ad835b7b69e267c45239d432b9d47ca5
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 17:07:00 2009 +0100
replaced rhnLib.getFileMD5 with checksum.getFileChecksum
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 7df7a87..c6eca42 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -25,6 +25,7 @@ import popen2
import select
import urlparse
from common import log_debug, log_error
+from spacewalk.common import checksum
try:
import hashlib
@@ -323,9 +324,11 @@ def rotateFile(filepath, depth=5, suffix='.', verbosity=0):
% os.path.dirname(pathNSuffix))
# is there anything to do? (existence, then size, then md5sum)
+ checksum_type = 'md5' # FIXME: this should be configuation option
if os.path.exists(pathNSuffix1) and os.path.isfile(pathNSuffix1) \
and os.stat(filepath)[6] == os.stat(pathNSuffix1)[6] \
- and getFileMD5(filepath) == getFileMD5(pathNSuffix1):
+ and checksum.getFileChecksum(checksum_type, filepath) == \
+ checksum.getFileChecksum(checksum_type, pathNSuffix1):
# nothing to do
if verbosity:
sys.stderr.write("File '%s' is identical to it's rotation. "
commit d3be2d3c0205d23e01ad4f8ab8325aaad6cc80cd
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 17:00:24 2009 +0100
replaced rhnLib.getFileMD5 with checksum.getFileChecksum
diff --git a/backend/server/handlers/app/packages.py b/backend/server/handlers/app/packages.py
index 8a76f7a..86cbdc6 100644
--- a/backend/server/handlers/app/packages.py
+++ b/backend/server/handlers/app/packages.py
@@ -23,7 +23,7 @@ import string
import tempfile
from types import TupleType
-from common import RPC_Base, rhnFault, log_debug, log_error, CFG, rhnLib
+from common import RPC_Base, rhnFault, log_debug, log_error, CFG
from server import rhnSQL, rhnPackageUpload, rhnUser, rhnSession
@@ -35,6 +35,7 @@ from server.importlib.backendOracle import OracleBackend
from server.importlib.packageUpload import uploadPackages, listChannels, listChannelsSource
from server.importlib.userAuth import UserAuth
from server.importlib.errataCache import schedule_errata_cache_update
+from spacewalk.common import checksum
#12/22/05 wregglej 173287
#I made a decent number of changes to this file to implement session authentication.
@@ -288,8 +289,8 @@ class Packages(RPC_Base):
relative_path = rhnPackageUpload.relative_path_from_header(
header, org_id=org_id)
- md5sum = rhnLib.getFileMD5(file=package_stream)
- checksum = ('md5', md5sum) # FIXME sha256
+ checksum = (header.checksum_type(),
+ checksum.getFileChecksum(header.checksum_type(), file=package_stream))
package_dict, diff_level = rhnPackageUpload.push_package(
header, payload_stream, checksum, org_id=org_id, force=force,
header_start=header_start, header_end=header_end,
diff --git a/backend/server/importlib/headerSource.py b/backend/server/importlib/headerSource.py
index fba9224..75ce91b 100644
--- a/backend/server/importlib/headerSource.py
+++ b/backend/server/importlib/headerSource.py
@@ -24,7 +24,8 @@ from importLib import File, Dependency, ChangeLog, Channel, \
IncompletePackage, Package, SourcePackage
from backendLib import gmtime, localtime
from types import ListType, TupleType, IntType
-from common import log_debug, rhnLib
+from common import log_debug
+from spacewalk.common import checksum
class rpmPackage(IncompletePackage):
# Various mappings
@@ -96,8 +97,8 @@ class rpmPackage(IncompletePackage):
if relpath:
# Strip trailing slashes
path = "%s/%s" % (sanitizePath(relpath), os.path.basename(f_path))
- md5sum = rhnLib.getFileMD5(file=f_obj)
- checksum = ('md5', md5sum) # FIXME sha256
+ checksum = (header.checksum_type(),
+ checksum.getFileChecksum(header.checksum_type(), file=f_obj))
self.populate(header, size, checksum, path, org_id, header_start,
header_end, channels)
commit 566f2ca1c28801e0bb85eb458d199ad4f252e156
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 16:54:12 2009 +0100
removed dead code
diff --git a/backend/satellite_tools/syncLib.py b/backend/satellite_tools/syncLib.py
index 2d25a9f..bc2ca80 100644
--- a/backend/satellite_tools/syncLib.py
+++ b/backend/satellite_tools/syncLib.py
@@ -355,49 +355,3 @@ def unique(s):
u.append(x)
return u
-def diffFileYN(filepath, mtime, size, md5sum):
- """mtime, size, and md5sum are what the file at filepath *should* be
- NOTE: I know it is broken, but mtime can be one of 4 things:
- None, "2003-05-28 08:36:22", an epoch (int), or an epoch (float)
- return: 1 == yes, they are different
- 0 == no, they are the same
- -1 == file doesn't even exist.
- side-effect: if the files are the same, but the mtime is different,
- then the mtime will be set to the mtime specified
- """
-
- if type(mtime) is type(''):
- mtime = time.mktime(time.strptime(mtime, '%Y-%m-%d %H:%M:%S'))
- _mtime = -1
- _size = -1
-
- st = None
- try:
- filepath = rhnLib.cleanupAbsPath(filepath)
- st = os.stat(filepath)
- except:
- # missing
- return -1
-
- if not os.path.exists(filepath):
- # missing
- return -1
-
- _mtime = st[-2]
- _size = st[-4]
-
- if size and size != _size:
- return 1
- elif not size or mtime != _mtime:
- # probably a mismatch... double-check with an md5sum check
- # NOTE: if size or mtime is None, they md5sum will be checked as well.
- _md5sum = rhnLib.getFileMD5(filepath)
- if md5sum != _md5sum:
- return 1
- elif mtime:
- # They are the same file, but the mtime are different.
- # Set the mtime to what it "should" be and move on.
- os.utime(filepath, (mtime, mtime))
- return 0
-
-
commit 97d1593e6a13bca82c76087e21e5862d8f9c0009
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 16:50:08 2009 +0100
use getFileChecksum from spacewalk.common.checksum
diff --git a/backend/upload_server/handlers/package_upload/package_upload.py b/backend/upload_server/handlers/package_upload/package_upload.py
index 44e2477..9fa63ae 100644
--- a/backend/upload_server/handlers/package_upload/package_upload.py
+++ b/backend/upload_server/handlers/package_upload/package_upload.py
@@ -22,9 +22,10 @@
import os
from mod_python import apache
-from common import CFG, log_debug, log_error, rhnFault, rhnFlags, rhnLib
+from common import CFG, log_debug, log_error, rhnFault, rhnFlags
from server import rhnPackageUpload, basePackageUpload
from server.rhnLib import get_package_path
+from spacewalk.common import checksum
class PackageUpload(basePackageUpload.BasePackageUpload):
def headerParserHandler(self, req):
@@ -74,7 +75,7 @@ class PackageUpload(basePackageUpload.BasePackageUpload):
header, payload_stream, header_start, header_end = \
rhnPackageUpload.load_package(temp_stream)
checksum = (header.checksum_type(),
- rhnLib.getFileChecksum(header.checksum_type(), file=temp_stream))
+ checksum.getFileChecksum(header.checksum_type(), file=temp_stream))
temp_stream.close()
if self.file_checksum != checksum:
commit b918afdf75e411a02a864f209d6d767a9739b301
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 16:48:08 2009 +0100
use getFileChecksum from spacewalk.common.checksum
diff --git a/backend/upload_server/handlers/package_push/package_push.py b/backend/upload_server/handlers/package_push/package_push.py
index cf052bf..f18c4b9 100644
--- a/backend/upload_server/handlers/package_push/package_push.py
+++ b/backend/upload_server/handlers/package_push/package_push.py
@@ -25,8 +25,9 @@ import string
from mod_python import apache
from rhn import rpclib
-from common import CFG, log_debug, log_error, rhnFault, rhnFlags, rhnLib
+from common import CFG, log_debug, log_error, rhnFault, rhnFlags
from server import rhnPackageUpload, rhnSQL, basePackageUpload
+from spacewalk.common import checksum
class PackagePush(basePackageUpload.BasePackageUpload):
def __init__(self, req):
@@ -115,7 +116,7 @@ class PackagePush(basePackageUpload.BasePackageUpload):
# Sanity check - removed, the package path can no longer be determined
# without the header
checksum = (header.checksum_type(),
- rhnLib.getFileChecksum(header.checksum_type(), file=temp_stream))
+ checksum.getFileChecksum(header.checksum_type(), file=temp_stream))
self.rel_package_path = rhnPackageUpload.relative_path_from_header(
header, org_id=self.org_id, checksum=checksum)
self.package_path = os.path.join(CFG.MOUNT_POINT,
commit 37d9ecdc96935a4476c80519f360f9dfc3a1bb56
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 16:42:15 2009 +0100
checksum has to be tuple
and use getFileChecksum from spacewalk.common.checksum
diff --git a/backend/server/rhnPackageUpload.py b/backend/server/rhnPackageUpload.py
index dfc9c63..da20e95 100644
--- a/backend/server/rhnPackageUpload.py
+++ b/backend/server/rhnPackageUpload.py
@@ -18,8 +18,8 @@
import os
import tempfile
-from common import CFG, log_debug, rhnFault, rhnLib, UserDictCase
-from spacewalk.common import rhn_mpm
+from common import CFG, log_debug, rhnFault, UserDictCase
+from spacewalk.common import rhn_mpm, checksum
from spacewalk.common.rhn_rpm import get_header_byte_range
from server import rhnSQL
@@ -313,7 +313,8 @@ def check_package_exists(package_path, package_checksum, force=0):
if not os.path.exists(package_path):
return
# File exists, same checksum?
- checksum = rhnLib.getFileChecksum(package_checksum[0], package_path)
+ checksum = (package_checksum[0],
+ checksum.getFileChecksum(package_checksum[0], package_path))
if package_checksum == checksum and not force:
raise AlreadyUploadedError(package_path)
if force:
commit be1fee1431bce4f0403b3d3e910f91dfe131300e
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 16:39:21 2009 +0100
use getFileChecksum from spacewalk.common.checksum
diff --git a/backend/server/importlib/importLib.py b/backend/server/importlib/importLib.py
index b8ccdee..0e19e4b 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -23,10 +23,11 @@ from UserDict import UserDict
from UserList import UserList
from common import log_debug
-from common.rhnLib import maketemp, getFileChecksum, createPath, setPermsPath
+from common.rhnLib import maketemp, createPath, setPermsPath
from server.rhnLib import get_package_path
from spacewalk.common import rhn_mpm
+from spacewalk.common.checksum import getFileChecksum
# no-op class, used to define the type of an attribute
class DateType:
@@ -840,8 +841,9 @@ def copy_package(fd, basedir, relpath, checksum, force=None):
# Is the file there already?
if os.path.isfile(packagePath) and not force:
# Get its checksum
- localsum = getFileChecksum(checksum[0], packagePath)
- if checksum[1] == localsum:
+ localsum = (checksum[0],
+ getFileChecksum(checksum[0], packagePath))
+ if checksum == localsum:
# Same file, so get outa here
return
raise FileConflictError(os.path.basename(packagePath))
commit 3a2c32a2deed5c274069adec45914eba2bf3f709
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 16:34:39 2009 +0100
replaced getFileMD5 with getFileChecksum
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 261afcc..5383582 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -31,7 +31,7 @@ from optparse import Option, OptionParser
# __rhn imports__
from common import CFG, initCFG, initLOG, Traceback, rhnMail, \
rhnLib, rhnFlags
-from spacewalk.common import rhn_rpm
+from spacewalk.common import rhn_rpm, checksum
from server import rhnSQL
from server.rhnSQL import SQLError, SQLSchemaError, SQLConnectError
@@ -915,18 +915,18 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
return get_package_path(nevra, org_id, prepend=CFG.PREPENDED_DIR,
source=source, checksum=checksum)
- def _verify_file(self, path, mtime, size, md5sum):
+ def _verify_file(self, path, mtime, size, checksum):
"""Verifies if the file is on the filesystem and matches the mtime and
- md5sum
- Computing the md5sum is costly, that's why we rely on mtime
+ checksum
+ Computing the checksum is costly, that's why we rely on mtime
comparisons.
Returns a tuple (error_code, ret_path) where:
- if the file has the specified mtime and md5sum, error_code is 0
+ if the file has the specified mtime and checksum, error_code is 0
and ret_path is None
- if the file has the md5sum, the function sets mtime, error_code is
+ if the file has the checksum, the function sets mtime, error_code is
0 and ret_path is path
- if the file exists but has a different md5sum, error_code is the
- file's current md5sum and ret_path is path
+ if the file exists but has a different checksum, error_code is the
+ file's current checksum and ret_path is path
if the file does not exist at all, error_code is 1 and ret_path is
null
The idea is that error_code is 0 if the file exists or something else
@@ -945,11 +945,12 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# Same mtime, and size, assume identity
return (0, None)
- # Have to check md5sum
- l_md5sum = rhnLib.getFileMD5(filename=abs_path)
- if l_md5sum != md5sum:
- # Different md5sums
- return (l_md5sum, path)
+ # Have to check checksum
+ l_checksum = (checksum[0],
+ checksum.getFileChecksum(checksum[0], filename=abs_path))
+ if l_checksum != checksum:
+ # Different checksums
+ return (l_checksum, path)
# Set the mtime
os.utime(abs_path, (mtime, mtime))
@@ -973,7 +974,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# Package is missing completely from the DB
m_channel_packages.append((package_id, path))
(errcode, ret_path) = self._verify_file(path,
- l_timestamp, package_size, md5sum)
+ l_timestamp, package_size, ('md5', md5sum)) # FIXME sha256
if errcode == 0:
# Package on the filesystem, and matches
return
@@ -991,7 +992,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# Check the filesystem
# This is one ugly piece of code
(errcode, ret_path) = self._verify_file(db_path, l_timestamp,
- package_size, md5sum)
+ package_size, ('md5', md5sum)) # FIXME sha256
if errcode != 0:
if errcode != 1 or path == db_path:
# Package is modified; fix it
@@ -1000,7 +1001,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
# Package is missing, and the DB path is, for some
# reason, not the same as the computed path.
(errcode, ret_path) = self._verify_file(path,
- l_timestamp, package_size, md5sum)
+ l_timestamp, package_size, ('md5', md5sum)) # FIXME sha256
if errcode != 1:
# Use the computed path
final_path = path
@@ -1422,7 +1423,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
md5sum = f['md5sum']
file_size = f['file_size']
(errcode, ret_path) = self._verify_file(dest_path,
- timestamp, file_size, md5sum)
+ timestamp, file_size, ('md5', md5sum)) # FIXME sha256
if errcode != 0:
# Have to download it
val = (kt_label, base_path, relative_path,
14 years, 5 months
5 commits - backend/common backend/satellite_tools backend/server backend/spacewalk spacewalk/certs-tools
by Michael Mraka
backend/common/rhnLib.py | 10 ----------
backend/satellite_tools/satsync.py | 3 ++-
backend/satellite_tools/xmlDiskSource.py | 2 +-
backend/server/configFilesHandler.py | 2 +-
backend/spacewalk/common/checksum.py | 2 +-
spacewalk/certs-tools/sslToolLib.py | 6 ------
6 files changed, 5 insertions(+), 20 deletions(-)
New commits:
commit a6cf06876de4ca5f3dc72aa2b7aabcccc126885f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 16:14:59 2009 +0100
removed dead code
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 3df3501..7df7a87 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -407,12 +407,6 @@ def getFileChecksum(hashtype, filename=None, fd=None, file=None, buffer_size=Non
return m.hexdigest()
-def getStringChecksum(hashtype, s):
- """ compute checksum of an arbitrary string """
- ctx = hashlib.new(hashtype, s)
- return ctx.hexdigest()
-
-
def rhn_popen(cmd, progressCallback=None, bufferSize=16384, outputLog=None):
""" popen-like function, that accepts execvp-style arguments too (i.e. an
array of params, thus making shell escaping unnecessary)
commit b1ad19e0018a49908e90934aecb1d7471afd9726
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 16:13:51 2009 +0100
removed dead code
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 18a6260..3df3501 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -407,10 +407,6 @@ def getFileChecksum(hashtype, filename=None, fd=None, file=None, buffer_size=Non
return m.hexdigest()
-def getStringMD5(s):
- """ compute md5sum of an arbitrary string """
- return getStringChecksum(s)
-
def getStringChecksum(hashtype, s):
""" compute checksum of an arbitrary string """
ctx = hashlib.new(hashtype, s)
diff --git a/spacewalk/certs-tools/sslToolLib.py b/spacewalk/certs-tools/sslToolLib.py
index 7e98e53..1871161 100644
--- a/spacewalk/certs-tools/sslToolLib.py
+++ b/spacewalk/certs-tools/sslToolLib.py
@@ -322,12 +322,6 @@ def getFileMD5(filename=None, fd=None, file=None, buffer_size=None):
return hexify_string(m.digest())
-def getStringMD5(s):
- "compute md5sum of an arbitrary string"
- ctx = md5.new(s)
- return hexify_string(ctx.digest())
-
-
def hexify_string(s):
return ("%02x" * len(s)) % tuple(map(ord, s))
commit 95a398106d4b0c621d7379ba120350475e794d52
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 15:59:17 2009 +0100
let's use getStringMD5 from spacewalk.common.checksum
diff --git a/backend/server/configFilesHandler.py b/backend/server/configFilesHandler.py
index 1b5576e..bec6637 100644
--- a/backend/server/configFilesHandler.py
+++ b/backend/server/configFilesHandler.py
@@ -21,7 +21,7 @@ import base64
import os
from common import rhnFault, rhnException, log_debug, CFG, rhnFlags
-from common.rhnLib import getStringMD5
+from spacewalk.common.checksum import getStringMD5
from server import rhnSQL, rhnUser, rhnCapability
from server.rhnHandler import rhnHandler
commit 89234c95243d301ecaf9c5355b996e481d115001
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 15:51:13 2009 +0100
getStringChecksum needs 2 params
diff --git a/backend/spacewalk/common/checksum.py b/backend/spacewalk/common/checksum.py
index 261d4ca..3756afb 100644
--- a/backend/spacewalk/common/checksum.py
+++ b/backend/spacewalk/common/checksum.py
@@ -76,7 +76,7 @@ def getFileChecksum(hashtype, filename=None, fd=None, file=None, buffer_size=Non
def getStringMD5(s):
""" compute md5sum of an arbitrary string """
- return getStringChecksum(s)
+ return getStringChecksum('md5', s)
def getStringChecksum(hashtype, s):
""" compute checksum of an arbitrary string """
commit 832886455858dc73015290a5fc57f8687138f3f6
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 14:53:16 2009 +0100
fixed import of createPath
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 4e5112a..261afcc 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -48,8 +48,9 @@ from progress_bar import ProgressBar
from xmlSource import FatalParseException, ParseException
from diskImportLib import rpmsPath
+from common.rhnLib import createPath
from syncLib import log, log2, log2disk, log2stderr, log2email, unique
-from syncLib import RhnSyncException, RpmManip, createPath, ReprocessingNeeded
+from syncLib import RhnSyncException, RpmManip, ReprocessingNeeded
from syncLib import initEMAIL_LOG, dumpEMAIL_LOG
from syncLib import FileCreationError, FileManip, intersection
diff --git a/backend/satellite_tools/xmlDiskSource.py b/backend/satellite_tools/xmlDiskSource.py
index 5d81247..827e29c 100644
--- a/backend/satellite_tools/xmlDiskSource.py
+++ b/backend/satellite_tools/xmlDiskSource.py
@@ -19,7 +19,7 @@
import os
import gzip
import string
-from syncLib import createPath
+from common.rhnLib import createPath
class MissingXmlDiskSourceFileError(Exception):
14 years, 5 months
backend/server client/rhel schema/spacewalk
by Jan Pazdziora
backend/server/handlers/xmlrpc/registration.py | 40 --------------
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 4 -
schema/spacewalk/common/tables/tables.deps | 2
3 files changed, 1 insertion(+), 45 deletions(-)
New commits:
commit db722bed34f414c573d6de2469f57428c22e03d2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 10 15:12:50 2009 +0100
The web_product_valid_numbers table does not exist in Spacewalk 0.7 / Satellite 5.3.
Thus, we delete functions that might ever think of touching
it eventually.
Even if we managed to invoke the validate_reg_num on the server,
it would fail with:
Exception Handler Information
Traceback (most recent call last):
File "/usr/share/rhn/server/apacheRequest.py", line 120, in call_function
response = apply(func, params)
File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 1187, in validate_reg_num
code = ValidNumber(prodcode)
File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 81, in ValidNumber
h.execute(regnum = reg_num)
File "/usr/share/rhn/server/rhnSQL/sql_base.py", line 161, in execute
return apply(self._execute_wrapper, (self._execute, ) + p, kw)
File "/usr/share/rhn/server/rhnSQL/driver_cx_Oracle.py", line 107, in _execute_wrapper
raise apply(sql_base.SQLStatementPrepareError, args)
SQLStatementPrepareError: ('ORA-00942: table or view does not exist\n', 942, 'select registered_flag flag from web_product_valid_numbers where reg_number = :regnum')
diff --git a/backend/server/handlers/xmlrpc/registration.py b/backend/server/handlers/xmlrpc/registration.py
index 4fdc5cd..4910c6a 100644
--- a/backend/server/handlers/xmlrpc/registration.py
+++ b/backend/server/handlers/xmlrpc/registration.py
@@ -69,22 +69,6 @@ def RegistrationNumber(nr):
return None
return ret
-# checks if a registration number is valid
-def ValidNumber(reg_num):
- reg_num = RegistrationNumber(reg_num)
- if not reg_num:
- return -1
- h = rhnSQL.prepare("""
- select registered_flag flag from web_product_valid_numbers
- where reg_number = :regnum
- """)
- h.execute(regnum = reg_num)
- row = h.fetchone_dict()
- if not row or not row.has_key("flag"):
- return -1
- flag = int(row["flag"])
- return not flag
-
#
# Functions that we will provide for the outside world
#
@@ -117,7 +101,6 @@ class Registration(rhnHandler):
self.functions.append("update_contact_info")
self.functions.append("update_packages")
self.functions.append("update_transactions")
- self.functions.append("validate_reg_num")
self.functions.append("virt_notify")
self.functions.append("welcome_message")
@@ -1212,29 +1195,6 @@ class Registration(rhnHandler):
self.__save_user(user)
return 0
- # Validate a registration number
- def validate_reg_num(self, prodcode):
- log_debug(1, prodcode)
- if not prodcode:
- raise rhnFault(16, _("""
- The product registration code can be found on the
- registration card included with the product"""))
- code = ValidNumber(prodcode)
- if code == 0: # already registered
- raise rhnFault(16, _("""
- The code that you have entered has been already
- registered. Please contact Red Hat Customer Support
- at http://www.redhat.com/services/tools/installation/
- """))
- elif code == -1:
- raise rhnFault(16, _("""
- Invalid product registration number.
- The product registration code can be found on the
- registration card included with the product. Please
- check carefully that you have entered the correct
- registration number. Invalid: %s""") % prodcode)
- return 0
-
# Updates the RPM transactions
def update_transactions(self, system_id, timestamp, transactions_hash):
log_debug(1)
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index b652356..974b4ba 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -316,10 +316,6 @@ def reserveUser(username, password):
s = rhnserver.RhnServer()
return s.registration.reserve_user(username, password)
-def validateRegNum(regNum):
- s = rhnserver.RhnServer()
- s.registration.validate_reg_num(regNum)
-
def registerUser(username, password, email = None):
s = rhnserver.RhnServer()
diff --git a/schema/spacewalk/common/tables/tables.deps b/schema/spacewalk/common/tables/tables.deps
index 1128cec..2d9fdcd 100644
--- a/schema/spacewalk/common/tables/tables.deps
+++ b/schema/spacewalk/common/tables/tables.deps
@@ -305,4 +305,4 @@ web_contact :: web_customer
web_user_contact_permission :: web_contact
web_user_site_info :: web_contact web_user_site_type
web_user_personal_info :: web_contact web_user_prefix
-web_customer_product :: rh_product web_product_valid_numbers
+web_customer_product :: rh_product
14 years, 5 months
Changes to 'refs/tags/spacewalk-java-0.8.2-1'
by Michael Mraka
Tag 'spacewalk-java-0.8.2-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2009-12-10 13:19 +0000
Tagging package [spacewalk-java] version [0.8.2-1] in directory [java/].
Changes since spacewalk-backend-0.8.6-1:
Michael Mraka (1):
Automatic commit of package [spacewalk-java] release [0.8.2-1].
---
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
---
14 years, 5 months
java/spacewalk-java.spec rel-eng/packages
by Michael Mraka
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 1e43467cc11e49efc700eece7ee376ac2c85c380
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 14:19:19 2009 +0100
Automatic commit of package [spacewalk-java] release [0.8.2-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index d475807..3cd8567 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -12,7 +12,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 0.8.1
+Version: 0.8.2
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -283,6 +283,9 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Thu Dec 10 2009 Michael Mraka <michael.mraka(a)redhat.com> 0.8.2-1
+- fixed support for SHA256 rpms
+
* Fri Dec 4 2009 Miroslav Suchý <msuchy(a)redhat.com> 0.8.1-1
- sha256 support
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 13b540c..448a4e9 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-0.8.1-1 java/
+0.8.2-1 java/
14 years, 5 months
Changes to 'refs/tags/spacewalk-backend-0.8.6-1'
by Michael Mraka
Tag 'spacewalk-backend-0.8.6-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2009-12-10 13:18 +0000
Tagging package [spacewalk-backend] version [0.8.6-1] in directory [backend/].
Changes since rhnpush-5.4.6-1:
Michael Mraka (1):
Automatic commit of package [spacewalk-backend] release [0.8.6-1].
---
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
---
14 years, 5 months
backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit b3aadbfa3a84cdac71e7860d597633cc734bc122
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Dec 10 14:18:07 2009 +0100
Automatic commit of package [spacewalk-backend] release [0.8.6-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index eebbba0..36eb6e0 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 0.8.5
+Version: 0.8.6
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -598,6 +598,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Thu Dec 10 2009 Michael Mraka <michael.mraka(a)redhat.com> 0.8.6-1
+- added support for uploading SHA256 rpms
+- 541078 - rhn-satellite-exporter --start-date and --end-date issues fixed
+
* Wed Dec 09 2009 Michael Mraka <michael.mraka(a)redhat.com> 0.8.5-1
- 516767 - create files with default repository owner/group/permissions
- removed duplicated code from syncLib
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 02cbd9f..29a0ed3 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-0.8.5-1 backend/
+0.8.6-1 backend/
14 years, 5 months
Changes to 'refs/tags/rhnpush-5.4.6-1'
by Michael Mraka
Tag 'rhnpush-5.4.6-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2009-12-10 13:16 +0000
Tagging package [rhnpush] version [5.4.6-1] in directory [client/tools/rhnpush/].
Changes since spacewalk-backend-0.8.5-1:
Michael Mraka (20):
fixed rpm build error
fixed namespace for rhn_rpm
added checksum routines to common library
removed unused getFileMD5()
added missing init files
removed unnecessary imports
replaced md5 with checksum
replaced computeMD5sum() with common getFileChecksum()
replaced MD5 functions with Checksum funcs
added getPackageChecksum* API calls
pkginfo is only package name, we have to use whole data structure
fixed number of params
comprare general checksums
fixed data type
added forgotten import
let's rhnpush understand sha256
missing digest is (empty) tuple not string now
let's backend understand File-Checksum* headers
fixed syntax error
Automatic commit of package [rhnpush] release [5.4.6-1].
Tomas Lestach (1):
541078 - Satellite 5.3.0 - rhn-satellite-exporter --start-date and --end-date issues
---
backend/satellite_tools/disk_dumper/iss.py | 5
backend/server/basePackageUpload.py | 13 -
backend/server/handlers/app/packages.py | 125 +++++++---
backend/server/rhnPackageUpload.py | 10
backend/spacewalk-backend.spec | 1
backend/spacewalk/__init__.py | 14 +
backend/spacewalk/common/__init__.py | 14 +
backend/spacewalk/common/checksum.py | 86 ++++++
backend/upload_server/handlers/package_push/package_push.py | 12
backend/upload_server/handlers/package_upload/package_upload.py | 24 +
client/tools/rhnpush/connection.py | 76 ------
client/tools/rhnpush/rhnpush.py | 68 ++---
client/tools/rhnpush/rhnpush.spec | 6
client/tools/rhnpush/rpm2mpm.py | 2
client/tools/rhnpush/solaris2mpm.py | 2
client/tools/rhnpush/uploadLib.py | 64 +----
rel-eng/packages/rhnpush | 2
17 files changed, 320 insertions(+), 204 deletions(-)
---
14 years, 5 months