backend/common/Makefile | 1
backend/common/UserDictCase.py | 79 -----------------
backend/common/rhnApache.py | 2
backend/common/rhnConfig.py | 2
backend/satellite_exporter/handlers/non_auth_dumper.py | 3
backend/server/basePackageUpload.py | 2
backend/server/handlers/xmlrpc/proxy.py | 2
backend/server/rhnSQL/driver_cx_Oracle.py | 2
backend/server/rhnSQL/driver_postgresql.py | 2
backend/server/rhnSQL/sql_row.py | 2
backend/server/rhnSQL/sql_table.py | 2
backend/server/rhnServer/server_hardware.py | 2
backend/server/rhnServer/server_wrapper.py | 2
backend/server/rhnUser.py | 2
backend/server/test/TestServer.py | 2
client/rhel/rhnlib/rhn/UserDictCase.py | 19 +++-
proxy/proxy/apacheHandler.py | 3
proxy/proxy/broker/rhnBroker.py | 3
proxy/proxy/rhnShared.py | 3
19 files changed, 35 insertions(+), 100 deletions(-)
New commits:
commit dcbda8b96d18de24cf4d6ad1f5d294787cc541c3
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 19 14:44:29 2011 +0200
merged backend/common/UserDictCase.py into rhnlib/rhn/UserDictCase.py
diff --git a/backend/common/Makefile b/backend/common/Makefile
index ab01f14..c0245be 100644
--- a/backend/common/Makefile
+++ b/backend/common/Makefile
@@ -23,7 +23,6 @@ SPACEWALK_FILES = __init__ \
rhnTB \
rhnTranslate \
RPC_Base \
- UserDictCase \
checksum \
fileutils \
rhn_deb \
diff --git a/backend/common/UserDictCase.py b/backend/common/UserDictCase.py
deleted file mode 100644
index 2a97492..0000000
--- a/backend/common/UserDictCase.py
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# Copyright (c) 2008--2010 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-#
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-#
-
-from types import StringType
-from UserDict import UserDict
-
-# A dictionary with case insensitive keys
-class UserDictCase(UserDict):
- def __init__(self, data = None):
- self.kcase = {}
- UserDict.__init__(self, data)
- # some methods used to make the class work as a dictionary
- def __setitem__(self, key, value):
- lkey = key
- if isinstance(key, StringType):
- lkey = key.lower()
- self.data[lkey] = value
- self.kcase[lkey] = key
- def __getitem__(self, key):
- if isinstance(key, StringType):
- key = key.lower()
- if not self.data.has_key(key):
- return None
- return self.data[key]
- def __delitem__(self, key):
- if isinstance(key, StringType):
- key = key.lower()
- del self.data[key]
- del self.kcase[key]
- get = __getitem__
- def keys(self):
- return self.kcase.values()
- def items(self):
- return self.get_hash().items()
- def has_key(self, key):
- if isinstance(key, StringType):
- key = key.lower()
- return self.data.has_key(key)
- def clear(self):
- self.data.clear()
- self.kcase.clear()
- # return this data as a real hash
- def get_hash(self):
- return reduce(lambda a, (ik, v), hc=self.kcase:
- a.update({ hc[ik] : v}) or a, self.data.items(), {})
-
- # return the data for marshalling
- def __getstate__(self):
- return self.get_hash()
- # we need a setstate because of the __getstate__ presence screws up deepcopy
- def __setstate__(self, state):
- self.__init__(state)
- # get a dictionary out of this instance ({}.update doesn't get instances)
- def dict(self):
- return self.get_hash()
- def update(self, updict):
- for (k, v) in updict.items():
- lk = k
- if isinstance(k, StringType):
- lk = k.lower()
- self.data[lk] = v
- self.kcase[lk] = k
- # Expose an iterator. This would normally fail if there is no iter()
- # function defined - but __iter__ will never be called on python 1.5.2
- def __iter__(self):
- return iter(self.data)
diff --git a/backend/common/rhnApache.py b/backend/common/rhnApache.py
index ec23ad2..e0f23e8 100644
--- a/backend/common/rhnApache.py
+++ b/backend/common/rhnApache.py
@@ -26,7 +26,7 @@ from spacewalk.common import apache
# Now local module imports
import rhnFlags
-from UserDictCase import UserDictCase
+from rhn.UserDictCase import UserDictCase
from rhnLog import log_debug
from rhnLog import log_error
from rhnTranslate import cat
diff --git a/backend/common/rhnConfig.py b/backend/common/rhnConfig.py
index 6c6b786..d532290 100644
--- a/backend/common/rhnConfig.py
+++ b/backend/common/rhnConfig.py
@@ -18,7 +18,7 @@ import sys
import glob
import stat
-from UserDictCase import UserDictCase
+from rhn.UserDictCase import UserDictCase
_CONFIG_ROOT = '/etc/rhn'
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py
b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 255b717..9f53cbf 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -19,6 +19,8 @@ Non-authenticated dumper
import os
import xmlrpclib
import gzip
+
+from rhn.UserDictCase import UserDictCase
from spacewalk.common.rhnLog import log_debug, log_error
from spacewalk.common.rhnConfig import CFG
from spacewalk.server import rhnSQL, rhnLib
@@ -27,7 +29,6 @@ from spacewalk.server.importlib.backendLib import localtime
from spacewalk.common.rhnException import rhnFault
from spacewalk.common.rhnTranslate import _
-from spacewalk.common.UserDictCase import UserDictCase
from spacewalk.satellite_tools.exporter import exportLib
from spacewalk.satellite_tools.disk_dumper import dumper
diff --git a/backend/server/basePackageUpload.py b/backend/server/basePackageUpload.py
index b77ce1b..02f1623 100644
--- a/backend/server/basePackageUpload.py
+++ b/backend/server/basePackageUpload.py
@@ -14,11 +14,11 @@
#
# $Id$
+from rhn.UserDictCase import UserDictCase
from spacewalk.common import apache
from spacewalk.common.rhnLog import log_debug
from spacewalk.common.rhnException import rhnFault
-from spacewalk.common.UserDictCase import UserDictCase
class BasePackageUpload:
diff --git a/backend/server/handlers/xmlrpc/proxy.py
b/backend/server/handlers/xmlrpc/proxy.py
index 70d2056..6fddce0 100644
--- a/backend/server/handlers/xmlrpc/proxy.py
+++ b/backend/server/handlers/xmlrpc/proxy.py
@@ -17,12 +17,12 @@
import time
# common module imports
+from rhn.UserDictCase import UserDictCase
from spacewalk.common import rhnFlags
from spacewalk.common.rhnLog import log_debug, log_error
from spacewalk.common.rhnConfig import CFG
from spacewalk.common.rhnException import rhnFault
from spacewalk.common.rhnTranslate import _
-from spacewalk.common.UserDictCase import UserDictCase
# local module imports
from spacewalk.server.rhnLib import computeSignature
diff --git a/backend/server/rhnSQL/driver_cx_Oracle.py
b/backend/server/rhnSQL/driver_cx_Oracle.py
index f7a2401..cf8b929 100644
--- a/backend/server/rhnSQL/driver_cx_Oracle.py
+++ b/backend/server/rhnSQL/driver_cx_Oracle.py
@@ -29,11 +29,11 @@ import os
import re
import types
+from rhn.UserDictCase import UserDictCase
from spacewalk.server import rhnSQL
from spacewalk.common import rhnConfig
from spacewalk.common.rhnLog import log_debug, log_error
from spacewalk.common.rhnException import rhnException
-from spacewalk.common.UserDictCase import UserDictCase
from sql_base import adjust_type
from const import ORACLE
diff --git a/backend/server/rhnSQL/driver_postgresql.py
b/backend/server/rhnSQL/driver_postgresql.py
index bb8014f..1dfddea 100644
--- a/backend/server/rhnSQL/driver_postgresql.py
+++ b/backend/server/rhnSQL/driver_postgresql.py
@@ -28,12 +28,12 @@ if not hasattr(psycopg2, 'extensions'):
import psycopg2.extensions
import sql_base
+from rhn.UserDictCase import UserDictCase
from spacewalk.server import rhnSQL
from spacewalk.server.rhnSQL import sql_types
from spacewalk.common.rhnLog import log_debug, log_error
from spacewalk.common.rhnException import rhnException
-from spacewalk.common.UserDictCase import UserDictCase
from const import POSTGRESQL
def convert_named_query_params(query):
diff --git a/backend/server/rhnSQL/sql_row.py b/backend/server/rhnSQL/sql_row.py
index d34ce67..0b9a9bb 100644
--- a/backend/server/rhnSQL/sql_row.py
+++ b/backend/server/rhnSQL/sql_row.py
@@ -17,8 +17,8 @@
import string
+from rhn.UserDictCase import UserDictCase
from spacewalk.common.rhnException import rhnException
-from spacewalk.common.UserDictCase import UserDictCase
import sql_base
import sql_lib
diff --git a/backend/server/rhnSQL/sql_table.py b/backend/server/rhnSQL/sql_table.py
index 1aa2a75..8171b1a 100644
--- a/backend/server/rhnSQL/sql_table.py
+++ b/backend/server/rhnSQL/sql_table.py
@@ -18,8 +18,8 @@
import string
+from rhn.UserDictCase import UserDictCase
from spacewalk.common.rhnException import rhnException
-from spacewalk.common.UserDictCase import UserDictCase
import sql_base
import sql_lib
diff --git a/backend/server/rhnServer/server_hardware.py
b/backend/server/rhnServer/server_hardware.py
index d6d38e3..4f69558 100644
--- a/backend/server/rhnServer/server_hardware.py
+++ b/backend/server/rhnServer/server_hardware.py
@@ -19,9 +19,9 @@
import string
+from rhn.UserDictCase import UserDictCase
from spacewalk.common.rhnLog import log_debug, log_error
from spacewalk.common.rhnException import rhnFault
-from spacewalk.common.UserDictCase import UserDictCase
from spacewalk.common.rhnTB import Traceback
from spacewalk.server import rhnSQL
diff --git a/backend/server/rhnServer/server_wrapper.py
b/backend/server/rhnServer/server_wrapper.py
index 758a6b6..11c4d52 100644
--- a/backend/server/rhnServer/server_wrapper.py
+++ b/backend/server/rhnServer/server_wrapper.py
@@ -24,7 +24,7 @@ from server_packages import Packages
from server_history import History
from server_solarispatches import SolarisPatches
-from spacewalk.common.UserDictCase import UserDictCase
+from rhn.UserDictCase import UserDictCase
from spacewalk.server import rhnSQL
class ServerWrapper(Packages, Hardware, History, SolarisPatches):
diff --git a/backend/server/rhnUser.py b/backend/server/rhnUser.py
index 5fab8bc..1399a2e 100644
--- a/backend/server/rhnUser.py
+++ b/backend/server/rhnUser.py
@@ -21,11 +21,11 @@ import crypt
import string
# Global Modules
+from rhn.UserDictCase import UserDictCase
from spacewalk.common.rhnLog import log_debug, log_error
from spacewalk.common.rhnConfig import CFG
from spacewalk.common.rhnException import rhnFault, rhnException
from spacewalk.common.rhnTranslate import _
-from spacewalk.common.UserDictCase import UserDictCase
import rhnSQL
import rhnSession
diff --git a/backend/server/test/TestServer.py b/backend/server/test/TestServer.py
index 26cb6a8..7c253e5 100644
--- a/backend/server/test/TestServer.py
+++ b/backend/server/test/TestServer.py
@@ -15,9 +15,9 @@
#
import time
+from rhn.UserDictCase import UserDictCase
from spacewalk.server import rhnSQL, rhnServer, rhnAction
from spacewalk.common import rhnConfig, rhnFlags
-from spacewalk.common.UserDictCase import UserDictCase
import server.xmlrpc.up2date
from misc_functions import create_activation_key
import misc_functions
diff --git a/client/rhel/rhnlib/rhn/UserDictCase.py
b/client/rhel/rhnlib/rhn/UserDictCase.py
index f5d5302..e6c217b 100644
--- a/client/rhel/rhnlib/rhn/UserDictCase.py
+++ b/client/rhel/rhnlib/rhn/UserDictCase.py
@@ -1,10 +1,21 @@
+#
+# Copyright (c) 2001--2011 Red Hat, Inc.
+#
+# This software is licensed to you under the GNU General Public License,
+# version 2 (GPLv2). There is NO WARRANTY for this software, express or
+# implied, including the implied warranties of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+# along with this software; if not, see
+#
http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+#
+# Red Hat trademarks are not licensed under GPLv2. No permission is
+# granted to use or replicate Red Hat trademarks that are incorporated
+# in this software or its documentation.
+#
+#
# This file implements a case insensitive dictionary on top of the
# UserDict standard python class
#
-# Copyright (c) 2001-2005, Red Hat Inc.
-# All rights reserved.
-#
-# $Id$
from types import StringType
from UserDict import UserDict
diff --git a/proxy/proxy/apacheHandler.py b/proxy/proxy/apacheHandler.py
index 8881c90..39b617b 100644
--- a/proxy/proxy/apacheHandler.py
+++ b/proxy/proxy/apacheHandler.py
@@ -26,12 +26,13 @@ from rhnConstants import *
from rhn import rpclib, connections
## common imports
+from rhn.UserDictCase import UserDictCase
from spacewalk.common.rhnConfig import CFG
from spacewalk.common.rhnLog import initLOG, log_debug, log_error
from spacewalk.common.rhnApache import rhnApache
from spacewalk.common.rhnTB import Traceback
from spacewalk.common.rhnException import rhnFault, rhnException
-from spacewalk.common import rhnFlags, UserDictCase, apache
+from spacewalk.common import rhnFlags, apache
from spacewalk.common.rhnLib import setHeaderValue
## local imports
diff --git a/proxy/proxy/broker/rhnBroker.py b/proxy/proxy/broker/rhnBroker.py
index b96bf46..cc83804 100644
--- a/proxy/proxy/broker/rhnBroker.py
+++ b/proxy/proxy/broker/rhnBroker.py
@@ -23,11 +23,12 @@ import re
from urlparse import urlsplit, urlparse, urlunparse
# common module imports
+from rhn.UserDictCase import UserDictCase
from spacewalk.common.rhnLib import parseUrl
from spacewalk.common.rhnConfig import CFG
from spacewalk.common.rhnLog import log_debug, log_error
from spacewalk.common.rhnException import rhnFault
-from spacewalk.common import UserDictCase, rhnFlags, apache
+from spacewalk.common import rhnFlags, apache
from spacewalk.common.rhnTranslate import _
# local module imports
diff --git a/proxy/proxy/rhnShared.py b/proxy/proxy/rhnShared.py
index 84131ef..172a812 100644
--- a/proxy/proxy/rhnShared.py
+++ b/proxy/proxy/rhnShared.py
@@ -26,11 +26,12 @@ from rhn import connections
from rhn.SSL import TimeoutException
## common imports
+from rhn.UserDictCase import UserDictCase
from spacewalk.common.rhnTB import Traceback
from spacewalk.common.rhnConfig import CFG
from spacewalk.common.rhnException import rhnFault, rhnException
from spacewalk.common.rhnLog import log_debug, log_error
-from spacewalk.common import UserDictCase, rhnFlags, rhnLib, apache
+from spacewalk.common import rhnFlags, rhnLib, apache
from spacewalk.common.rhnTranslate import _
## local imports