diff --git a/branches/ucs-3.0/ucs/base/univention-updater/modules/univention/updater/mirror.py b/branches/ucs-3.0/ucs/base/univention-updater/modules/univention/updater/mirror.py index 9e0ecc0..fc3bf4b 100644 --- a/branches/ucs-3.0/ucs/base/univention-updater/modules/univention/updater/mirror.py +++ b/branches/ucs-3.0/ucs/base/univention-updater/modules/univention/updater/mirror.py @@ -48,14 +48,10 @@ class UniventionMirror( UniventionUpdater ): UniventionUpdater.__init__(self, check_access) self.repository_path = self.configRegistry.get( 'repository/mirror/basepath', '/var/lib/univention-repository' ) - if self.configRegistry.has_key( 'repository/mirror/version/end' ): - self.version_end = UCS_Version( self.configRegistry.get( 'repository/mirror/version/end' ) ) - else: - self.version_end = UCS_Version( ( self.version_major, self.version_minor, self.patchlevel ) ) - if self.configRegistry.has_key( 'repository/mirror/version/start' ): - self.version_start = UCS_Version( self.configRegistry.get( 'repository/mirror/version/start' ) ) - else: - self.version_start = UCS_Version( ( self.version_major, 0, 0 ) ) + version_end = self.configRegistry.get('repository/mirror/version/end') or self.current_version + self.version_end = UCS_Version(version_end) + version_start = self.configRegistry.get('repository/mirror/version/start') or (self.version_major, 0, 0) + self.version_start = UCS_Version(version_start) # set architectures to mirror archs = self.configRegistry.get( 'repository/mirror/architectures', '' ) if archs: diff --git a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-errata-components-update b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-errata-components-update index efd9e59..7fa439c 100755 --- a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-errata-components-update +++ b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-errata-components-update @@ -231,7 +231,7 @@ if __name__ == '__main__': if configRegistry.is_true('local/repository', False): local_repository = True # if there is no _new_ repository server -> exit - if configRegistry.has_key( 'repository/local/old' ): + if configRegistry.get('repository/local/old'): update_status( status='FAILED', errorsource='SETTINGS' ) dprint( 'The repository server directory structure has been changed with UCS 2.2-0. The local repository still has the old structure and can not be used for updates anymore. Please migrate the repository to the new directory structure or disable the local repository by setting the UCR variable local/repository to "no". Information on how to migrate the repository can be found in the release notes for UCS 2.2-0', [fp_debug,sys.stderr] ) sys.exit( 1 ) diff --git a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-errata-update b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-errata-update index 56ba683..9bdb054 100755 --- a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-errata-update +++ b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-errata-update @@ -205,7 +205,7 @@ if __name__ == '__main__': if configRegistry.is_true('local/repository', False): local_repository = True # if there is no _new_ repository server -> exit - if configRegistry.has_key( 'repository/local/old' ): + if configRegistry.get('repository/local/old'): update_status( status='FAILED', errorsource='SETTINGS' ) dprint( 'The repository server directory structure has been changed with UCS 2.2-0. The local repository still has the old structure and can not be used for updates anymore. Please migrate the repository to the new directory structure or disable the local repository by setting the UCR variable local/repository to "no". Information on how to migrate the repository can be found in the release notes for UCS 2.2-0', [fp_debug,sys.stderr] ) sys.exit( 1 ) diff --git a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-create b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-create index 3d060ee..602eaa0 100755 --- a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-create +++ b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-create @@ -251,7 +251,7 @@ if __name__ == '__main__': ucr.handler_set( [ 'repository/online/server=%s' % fqdn ] ) # unset UCR variable marking old repository - if configRegistry.has_key( 'repository/local/old' ): + if 'repository/local/old' in configRegistry: ucr.handler_unset( 'repository/local/old' ) # set start version for synchronsation of repository diff --git a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-merge b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-merge index 03574cf..a4c13e5 100755 --- a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-merge +++ b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-merge @@ -84,9 +84,10 @@ def walking(arg, dirname, names): arch = ' '.join(line.split(' ', 1)[1:]) key = (package, arch) - if l_package.has_key(key): - if compare(version, l_package[key][1]): - p_remove.append(l_package[key][0]) + record = l_package.get(key) + if record: + if compare(version, record[1]): + p_remove.append(record[0]) l_package[key]=[file, version, arg] else: p_remove.append(file) diff --git a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-migrate b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-migrate index 235ccbd..c298d5b 100755 --- a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-migrate +++ b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-migrate @@ -217,8 +217,8 @@ if __name__ == '__main__': migrate_repository( options ) # unset UCR variable makring old repository - if configRegistry.has_key( 'repository/local/old' ): - os.system('/usr/sbin/univention-config-registry unset repository/local/old') + if 'repository/local/old' in configRegistry: + ucr.handler_unset( 'repository/local/old' ) finally: if not univention.updater.tools.updater_lock_release(lock): print 'WARNING: updater-lock already released!' diff --git a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-update b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-update index f915f4f..d363940 100755 --- a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-update +++ b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-repository-update @@ -259,7 +259,7 @@ if __name__ == '__main__': sys.exit( 1 ) # if there is no _new_ repository server -> exit - if configRegistry.has_key( 'repository/local/old' ): + if configRegistry.get('repository/local/old'): print >> options.teefile, 'The repository server directory structure has been changed with UCS 2.2-0. The local repository still has the old structure and can not be used for updates anymore. Please migrate the repository to the new directory structure or disable the local repository by setting the UCR variable local/repository to "no". Information on how to migrate the repository can be found in the release notes for UCS 2.2-0' sys.exit( 1 ) diff --git a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-updater b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-updater index 8324709..9f601e5 100755 --- a/branches/ucs-3.0/ucs/base/univention-updater/python/univention-updater +++ b/branches/ucs-3.0/ucs/base/univention-updater/python/univention-updater @@ -410,7 +410,7 @@ def main(): architecture=os.popen('dpkg --print-architecture 2>/dev/null').readline()[:-1] # if there is no _new_ repository server -> exit - if baseConfig.get( 'local/repository', '' ).lower() in ( 'yes', 'true' ) and baseConfig.has_key( 'repository/local/old' ): + if baseConfig.is_true('local/repository', False) and baseConfig.get('repository/local/old'): dprint( 'The repository server directory structure has been changed with UCS 2.2-0. The local repository still has the old structure and can not be used for updates anymore. Please migrate the repository to the new directory structure or disable the local repository by setting the UCR variable local/repository to "no". Information on how to migrate the repository can be found in the release notes for UCS 2.2-0') sys.exit( 1 )