Bug 41238 - univention-upgrade with --updateto is broken
univention-upgrade with --updateto is broken
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Update - univention-updater
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-1-errata
Assigned To: Philipp Hahn
Erik Damrose
:
Depends on: 40338
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-10 13:13 CEST by Stefan Gohmann
Modified: 2016-10-04 13:56 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.103
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2016-05-10 13:13:35 CEST
Backport to 4.1-1

+++ This bug was initially created as a clone of Bug #41237 +++

With r67588 univention-upgrade was modified to improve the update process. This introduced the following problem:

If --updateto is used, the updater checks if the target UCS version is reached, but this comparison is broken, leading to the following traceback:

Traceback (most recent call last):
  File "/usr/sbin/univention-upgrade", line 429, in do_update
    update_available = performUpdate(options, checkForUpdates=options.check, silent=False)
  File "/usr/sbin/univention-upgrade", line 137, in performUpdate
    if func(options, checkForUpdates, silent):
  File "/usr/sbin/univention-upgrade", line 153, in do_release_update
    if options.updateto and UCS_Version(options.updateto) < version_next:
  File "/usr/lib/pymodules/python2.7/univention/updater/ucs_version.py", line 88, in __cmp__
    return cmp(self.mmp, right.mmp)
AttributeError: 'str' object has no attribute 'mmp'

The following patch fixes the issue for me by converting the string to a UCS_Version object:

Index: python/univention-upgrade
===================================================================
--- python/univention-upgrade   (Revision 69228)
+++ python/univention-upgrade   (Arbeitskopie)
@@ -150,7 +150,7 @@
     if not version_next:
         dprint(silent, 'none')
         return False
-    if options.updateto and UCS_Version(options.updateto) < version_next:
+    if options.updateto and UCS_Version(options.updateto) < UCS_Version(version_next):
         dprint(silent, '%s is available but updater has been instructed to stop at version %s.' % (version_next, options.updateto))
         return False
     dprint(silent, 'found: UCS %s' % version_next)
Comment 1 Philipp Hahn univentionstaff 2016-05-10 14:06:00 CEST
r69235 | Bug #41238: Fix comparison of --updateto

Package: univention-updater
Version: 11.0.9-10.1474.201605101346
Branch: ucs_4.1-0
Scope: errata4.1-1

r69237 | Bug #41238 up: Fix comparison of --updateto YAML
 univention-updater.yaml
Comment 2 Erik Damrose univentionstaff 2016-05-10 14:28:59 CEST
OK: Patch applied
OK: Update to new updater 11.0.9-10.1474.201605101346
OK: univention-upgrade --updateto 4.1-99
 - Works with old updater (new version is installed, then dist-upgrade happens)
 - Works with new updater

OK: version smaller than in UCS 4.1-2
OK: yaml
-> Verified
Comment 3 Janek Walkenhorst univentionstaff 2016-05-10 15:15:10 CEST
<http://errata.software-univention.de/ucs/4.1/175.html>