Lines 462-468
class Application(object):
|
Link Here
|
---|
|
462 |
def get_metainf_url(cls): |
462 |
def get_metainf_url(cls): |
463 |
# during a release upgrade, find ini files |
463 |
# during a release upgrade, find ini files |
464 |
# of the new release |
464 |
# of the new release |
465 |
version = ucr.get('version/version/target') |
465 |
version = cls._get_next_version() |
466 |
if version is None: |
466 |
if version is None: |
467 |
version = ucr.get('version/version', '') |
467 |
version = ucr.get('version/version', '') |
468 |
return '%s/meta-inf/%s' % ( |
468 |
return '%s/meta-inf/%s' % ( |
Lines 471-476
class Application(object):
|
Link Here
|
---|
|
471 |
) |
471 |
) |
472 |
|
472 |
|
473 |
@classmethod |
473 |
@classmethod |
|
|
474 |
def _get_next_version(cls): |
475 |
still_running = False |
476 |
version = None |
477 |
try: |
478 |
with open('/var/lib/univention-updater/univention-updater.status', 'r') as status: |
479 |
for line in status: |
480 |
line = line.strip() |
481 |
key, value = line.split("=", 1) |
482 |
if key == 'status': |
483 |
still_running = value == 'RUNNING' |
484 |
elif key == 'next_version': |
485 |
version = value.split('-')[0] |
486 |
except (IOError, ValueError) as ex: |
487 |
MODULE.warn('Could no parse update.status: %s' % (ex,)) |
488 |
return version if still_running else None |
489 |
|
490 |
@classmethod |
474 |
def find(cls, application_id): |
491 |
def find(cls, application_id): |
475 |
for application in cls.all(): |
492 |
for application in cls.all(): |
476 |
if application.id == application_id: |
493 |
if application.id == application_id: |