diff --git a/branches/ucs-3.2/ucs-3.2-0/management/univention-management-console-module-appcenter/umc/python/appcenter/app_center.py b/branches/ucs-3.2/ucs-3.2-0/management/univention-management-console-module-appcenter/umc/python/appcenter/app_center.py index ed0eb78..cc47414 100644 --- a/branches/ucs-3.2/ucs-3.2-0/management/univention-management-console-module-appcenter/umc/python/appcenter/app_center.py +++ b/branches/ucs-3.2/ucs-3.2-0/management/univention-management-console-module-appcenter/umc/python/appcenter/app_center.py @@ -462,7 +462,7 @@ class Application(object): def get_metainf_url(cls): # during a release upgrade, find ini files # of the new release - version = ucr.get('version/version/target') + version = cls._get_next_version() if version is None: version = ucr.get('version/version', '') return '%s/meta-inf/%s' % ( @@ -471,6 +471,23 @@ class Application(object): ) @classmethod + def _get_next_version(cls): + still_running = False + version = None + try: + with open('/var/lib/univention-updater/univention-updater.status', 'r') as status: + for line in status: + line = line.strip() + key, value = line.split("=", 1) + if key == 'status': + still_running = value == 'RUNNING' + elif key == 'next_version': + version = value.split('-')[0] + except (IOError, ValueError) as ex: + MODULE.warn('Could no parse update.status: %s' % (ex,)) + return version if still_running else None + + @classmethod def find(cls, application_id): for application in cls.all(): if application.id == application_id: