Handle release-upgrade messages in the packagemanager plugin

Bug #455217 reported by Free Ekanayaka on 2009-10-19
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Client
Medium
Free Ekanayaka
landscape-client (Ubuntu)
Undecided
Unassigned
Intrepid
Undecided
Unassigned
Jaunty
Undecided
Unassigned
Karmic
Undecided
Unassigned
Lucid
Undecided
Unassigned

Bug Description

The client should handle messages for type "release-upgrade", which are
going to be issued by the server for requesting a system upgrade to a
newer release.

The packagemanager plugin should handle this message by enqueuing a task
for a release-upgrader task handler.

 affects landscape
 status inprogress
 importance medium
 assignee free.ekanayaka
 milestone later
 private yes

Free Ekanayaka (free.ekanayaka) wrote :

This branch is ready for review. The release-upgrader task handler is still a dummy one, it's implemented in a coming branch.

tags: added: review
Jamu Kakar (jkakar) wrote :

[1]

+class InvalidGpgSignature(Exception):
+class GpgTest(LandscapeTest):

Please use capital letters for abbreviations in type names:

class InvalidGPGSignature(Exception):
class GPGTest(LandscapeTest):

[2]

+ def remove_gpg_home(passthrough):
+ try:
+ os.remove(os.path.join(gpg_home, "trustdb.gpg"))
+ except OSError:
+ # GPG has failed, just pass through whatever failure
+ pass
+ os.rmdir(gpg_home)
+ return passthrough

You can write this a bit more simply as:

import shutil

    def remove_gpg_home(ignored):
        shutil.rmtree(gpg_home)
        return ignored

Looking good, +1!

Free Ekanayaka (free.ekanayaka) wrote :

Thanks Jamu! [1] and [2] addressed in r157.

Thomas Herve (therve) wrote :

[1] I see that you're runing gpg: do we need to add a dependency for it?

[2]
+ def __init__(self):
+ self._package_store = None

It should still upcall init for future use. You can also remove the init completely here and set a class attribute.

[3]
+ def handle_message(self, message):
+ """Queue C{message} as a task, and spawn the proper handler."""
+ if message["type"] == "change-packages":
+ cls = PackageChanger
+ if message["type"] == "release-upgrade":
+ cls = ReleaseUpgrader

I think you should create 2 different methods for not having to do an if, and use that in register_message. Something like that:

def handle_changer
     return _handle(PackageChanger, message)
def handle_upgrade
     return _handle(ReleaseUpgrader, message)

[4]
+ if cls == PackageChanger:
+ return find_changer_command()
+ if cls == ReleaseUpgrader:
+ return find_release_upgrader_command()

In the same spirit, what about adding a find_command on those classes?

+1!

tags: removed: review
Free Ekanayaka (free.ekanayaka) wrote :

Thanks Thomas!

[1]

That is fixed in the coming release-upgrader branch which actually uses that code. We're going to depend on two new packages, python-apt and python-gnupginterface. We don't use them directly but their modules are imported by the upgrade-tool. The latter package depends on gnupg.

[2], [3], [4]

Very nice hints, all fixed.

Changed in landscape:
status: In Progress → Fix Committed
affects: landscape → landscape-client
Changed in landscape-client:
milestone: later → none
status: Fix Committed → In Progress
milestone: none → 1.4.1
status: In Progress → Fix Committed
tags: added: needs-testing
tags: removed: needs-testing
Jamu Kakar (jkakar) on 2009-12-16
tags: added: 1.5-upgrade-client
visibility: private → public

Accepted landscape-client into intrepid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in landscape-client (Ubuntu Intrepid):
status: New → Fix Committed
tags: added: verification-needed
Changed in landscape-client (Ubuntu Jaunty):
status: New → Fix Committed
Martin Pitt (pitti) wrote :

Accepted landscape-client into jaunty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in landscape-client (Ubuntu Lucid):
status: New → Fix Released
Martin Pitt (pitti) wrote :

Accepted landscape-client into karmic-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in landscape-client (Ubuntu Karmic):
status: New → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 1.4.0-0ubuntu0.8.10.0

---------------
landscape-client (1.4.0-0ubuntu0.8.10.0) intrepid-proposed; urgency=low

  * New upstream release (LP: #497351)

  * Bug fixes:
    - Fix landscape daemons fail to start when too many groups are
      available (LP: #456124)
    - Fix landscape programs wake up far too much. (LP: #340843)
    - Fix Package manager fails with 'no such table: task' (LP #465846)
    - Fix test suite leaving temporary files around (LP #476418)
    - Fix the 1hr long wait for user data to be uploaded following a
      resynchronisation (LP #369000)

  * Add support for Ubuntu release upgrades:
    - Add helper function to fetch many files at once (LP: #450629)
    - Handle release-upgrade messages in the packagemanager
      plugin (LP: #455217)
    - Add a release-upgrader task handler (LP: #462543)
    - Support upgrade-tool environment variables (LP: #463321)

  * Add initial support for Smart package locking:
    - Detect and report changes about Smart package locks (#488108)

  * Packaging fixes:
    - Turn unnecessary Pre-Depends on python-gobject into a regular Depends
    - If it's empty, remove /etc/landscape upon purge
 -- Free Ekanayaka <email address hidden> Wed, 16 Dec 2009 10:50:05 +0100

Changed in landscape-client (Ubuntu Intrepid):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 1.4.0-0ubuntu0.9.04.0

---------------
landscape-client (1.4.0-0ubuntu0.9.04.0) jaunty-proposed; urgency=low

  * New upstream release (LP: #497351)

  * Bug fixes:
    - Fix landscape daemons fail to start when too many groups are
      available (LP: #456124)
    - Fix landscape programs wake up far too much. (LP: #340843)
    - Fix Package manager fails with 'no such table: task' (LP #465846)
    - Fix test suite leaving temporary files around (LP #476418)
    - Fix the 1hr long wait for user data to be uploaded following a
      resynchronisation (LP #369000)

  * Add support for Ubuntu release upgrades:
    - Add helper function to fetch many files at once (LP: #450629)
    - Handle release-upgrade messages in the packagemanager
      plugin (LP: #455217)
    - Add a release-upgrader task handler (LP: #462543)
    - Support upgrade-tool environment variables (LP: #463321)

  * Add initial support for Smart package locking:
    - Detect and report changes about Smart package locks (#488108)

  * Packaging fixes:
    - Turn unnecessary Pre-Depends on python-gobject into a regular Depends
    - If it's empty, remove /etc/landscape upon purge
 -- Free Ekanayaka <email address hidden> Wed, 16 Dec 2009 10:50:05 +0100

Changed in landscape-client (Ubuntu Jaunty):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 1.4.0-0ubuntu0.9.10.0

---------------
landscape-client (1.4.0-0ubuntu0.9.10.0) karmic-proposed; urgency=low

  * New upstream release (LP: #497351)

  * Bug fixes:
    - Fix landscape daemons fail to start when too many groups are
      available (LP: #456124)
    - Fix landscape programs wake up far too much. (LP: #340843)
    - Fix Package manager fails with 'no such table: task' (LP #465846)
    - Fix test suite leaving temporary files around (LP #476418)
    - Fix the 1hr long wait for user data to be uploaded following a
      resynchronisation (LP #369000)

  * Add support for Ubuntu release upgrades:
    - Add helper function to fetch many files at once (LP: #450629)
    - Handle release-upgrade messages in the packagemanager
      plugin (LP: #455217)
    - Add a release-upgrader task handler (LP: #462543)
    - Support upgrade-tool environment variables (LP: #463321)

  * Add initial support for Smart package locking:
    - Detect and report changes about Smart package locks (#488108)

  * Packaging fixes:
    - Turn unnecessary Pre-Depends on python-gobject into a regular Depends
    - If it's empty, remove /etc/landscape upon purge
 -- Free Ekanayaka <email address hidden> Wed, 16 Dec 2009 10:50:05 +0100

Changed in landscape-client (Ubuntu Karmic):
status: Fix Committed → Fix Released
tags: removed: verification-needed
Changed in landscape-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers