Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update [release-1_6_0-branch]: /current/src/, /current/src/db/, /current/src/db/postgres/

Project highlights: Stable Version: 1.6.1, Development Version: 1.7.6

current
Discussion topic

Back to topic list

CVS update [release-1_6_0-branch]: /current/src/, /current/src/db/, /current/src/db/postgres/

Reply

Author jjneely
Full name Jack Neely
Date 2005-07-19 20:19:45 PDT
Message Tag: release-1_6_0-branch
User: jjneely
Date: 2005/07/19 20:19:45

Modified:
   current/src/archtab.py
   current/src/auth.py
   current/src/db/currentdb.py
   current/src/db/postg​res/postgres.py

Log:
 Issues: 36, 33, 32, and 35. Intended for a 1.6.1 release.
 

File Changes:

Directory: /current/src/
========================

File [changed]: archtab.py
Url: http://current.tigri​s.org/source/browse/​current/src/archtab.​py?r1=1.3&r2=1.3​.2.1
Delta lines: +23 -48
---------------------
--- archtab.py 4 Oct 2004 18:02:01 -0000 1.3
+++ archtab.py 20 Jul 2005 03:19:42 -0000 1.3.2.1
@@ -4,25 +4,37 @@
 However, there are no mechanisms available to us for use on a _server_
 that may have a different arch than a client. So, we reinvent the wheel.
 
-Copyright 2002 Hunter Matthews
+Copyright 2002, 2005 Hunter Matthews and Jack Neely
 
 This software may be freely redistributed under the terms of the GNU Public
 License (GPL) v2.
 
-The compat_arches_table and related functions are from the up2dateUtils.py
-file from RH's up2date client. That files copyright info follows:
-
- Client code for Update Agent
- Copyright (c) 1999-2001 Red Hat, Inc. Distributed under GPL.
-
- Author: Preston Brown <pbrown at redhat dot com>
- Adrian Likins <alikins at redhat dot com>
-
+Parts of the code taken from archwork.py in Yum Copyright 2002 Duke University.
 
 """
 
+import os
+import re
+
 from logger import *
 
+def getArch(arch=None):
+ if not arch:
+ arch = os.uname()[4]
+ newarch = None
+ if re.search('86', arch):
+ newarch = 'i386'
+ if re.search('sparc', arch) or re.search('sun', arch):
+ newarch = 'sparc'
+ if re.search('alpha', arch):
+ newarch = 'alpha'
+ if re.search('ppc', arch):
+ newarch = 'ppc'
+ if re.search('x86_64', arch):
+ newarch = 'x86_64'
+ if not newarch:
+ newarch = arch
+ return newarch
 
 def getCannonArch(arch):
     """ Translate an arch into its base platform name.
@@ -38,42 +50,5 @@
     # We assume that we can split off of '-'s and take the first element.
     arch = arch.split('-')[0]
     
- assert arch in _compat_arches_table.keys(), \
- "Arch table does not contain %s architecture." % arch
- return _compat_arches_table[arch][0]
-
-
-# NOTE: The order of the stuff in compat is in newest->oldest order
-# assuming backwards compability
-# I think there is a bug in rpm, in that althon's should not use i686
-# kernels, however, thats what we are duplicating, so thats whats in
-# the table.
-_compat_arches_table = {
- # ARCH : # CANON, # COMPAT
- "noarch" : [ "noarch", "noarch" ],
-
- "i386" : [ "i386", "i386", "noarch" ],
- "i486" : [ "i386", "i486", "i386", "noarch" ],
- "i586" : [ "i386", "i586", "i486", "i386", "noarch" ],
- "i686" : [ "i386", "i686", "i586", "i486", "i386", "noarch" ],
- "athlon" : [ "i386", "athlon", "i686", "i586", "i486", "i386", "noarch" ],
-
- "alpha" : [ "alpha", "alpha", "noarch" ],
- "alphaev5" : [ "alpha", "alphaev5", "alpha", "noarch" ],
- "alphaev56" : [ "alpha", "alphaev56", "alphaev5", "alpha", "noarch" ],
- "alphaca56" : [ "alpha", "alphaca56", "alphaev56", "alphaev5", "alpha", "noarch" ],
- "alphaev6" : [ "alpha", "alphaev6", "alphaca56", "alphaev56", "alphaev5", "alpha", "noarch" ],
- "alphaev67" : [ "alpha", "alphaev67", "alphaev6", "alphaca56", "alphaev56", "alphaev5", "alpha", "noarch" ],
-
- "sparc" : [ "sparc", "sparc", "noarch" ],
- "sparcv9" : [ "sparc", "sparcv9", "sparc", "noarch" ],
- "sparc64" : [ "sparc", "sparc64", "sparcv9", "sparc", "noarch" ],
-
- "ia64" : [ "ia64", "ia64", "i686", "noarch" ],
-
- "x86_64" : [ "x86_64", "noarch" ],
-
- "src" : [ "SRPMS", "src" ],
- }
-
+ return getArch(arch)
     

File [changed]: auth.py
Url: http://current.tigri​s.org/source/browse/​current/src/auth.py?​r1=1.5&r2=1.5.2.​1
Delta lines: +8 -6
-------------------
--- auth.py 15 Feb 2005 03:29:24 -0000 1.5
+++ auth.py 20 Jul 2005 03:19:42 -0000 1.5.2.1
@@ -203,23 +203,25 @@
     def addAuthChannel(self, chanInfo):
         """ Append to our authorized channels list. """
 
- new_chan = [chanInfo['label'], chanInfo['lastupdate']]
+ new_chan = [str(chanInfo['label']),
+ str(chanInfo['lastupdate'])]
+
         self.data['X-RHN-Aut​h-Channels'].append(​new_chan)
 
 
     def _calcChecksum(self):
         """ Calculate the checksum field of the header id. """
         
- str = configure.config['se​rver_secret']
+ s = configure.config['se​rver_secret']
         for attr in ['X-RHN-Auth-User-Id', 'X-RHN-Server-Id',
                      'X-RHN-Auth-Expiration']:
- str = str + self.data[attr]
+ s = s + self.data[attr]
 
         # Can't append a list of lists to a string
         for chan in self.data['X-RHN-Aut​h-Channels']:
- str = str + chan[0] + ':' + chan[1]
+ s = s + str(chan[0]) + ':' + str(chan[1])
 
- sum = sha.new(str)
+ sum = sha.new(s)
         return sum.hexdigest()
                     
 

Directory: /current/src/db/
===========================

File [changed]: currentdb.py
Url: http://current.tigri​s.org/source/browse/​current/src/db/curre​ntdb.py?r1=1.8&r​2=1.8.2.1
Delta lines: +6 -1
-------------------
--- currentdb.py 15 Feb 2005 03:29:26 -0000 1.8
+++ currentdb.py 20 Jul 2005 03:19:42 -0000 1.8.2.1
@@ -75,7 +75,12 @@
            we need to be able to abore the transaction."""
         
         log("Database transaction aborted!", VERBOSE)
+ try:
         self.conn.rollback()
+ except Exception, e:
+ log("Database Corruption! Cannot rollback database!",
+ MANDATORY)
+ log("Database said: %s" % str(e), MANDATORY)
 
 
     def makeChannel(self, channel):

Directory: /current/src/db/postgres/
====================​================

File [changed]: postgres.py
Url: http://current.tigri​s.org/source/browse/​current/src/db/postg​res/postgres.py?r1=1​.35&r2=1.35.2.1
Delta lines: +1 -1
-------------------
--- postgres.py 4 Oct 2004 18:02:02 -0000 1.35
+++ postgres.py 20 Jul 2005 03:19:43 -0000 1.35.2.1
@@ -33,7 +33,7 @@
             log("Connected via user/password", TRACE)
         except Exception, e:
             log("Could not get DB connection!", MANDATORY)
- logexception()
+ logException()
             # Do something useful here?
             raise

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update [release-1_6_0-branch]: /current/src/, /current/src/db/, /current/src/db/postgres/ jjneely Jack Neely 2005-07-19 20:19:45 PDT
Messages per page: