Add a release-upgrader task handler

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

Bug Description

Add a new landscape-release-upgrader task handler script and class to
perform release upgrades.

The release-upgrader should fetch, verify and run the upgrade tool for
the target release specified by the task being handled.

 affects landscape-client
 status inprogress
 importance medium
 assignee free.ekanayaka
 milestone 1.4.1

tags: added: review
Revision history for this message
Thomas Herve (therve) wrote :

[1]
+ifneq (,$(findstring $(dist_release),"hardy"))
+ # We want update-motd in intrepid and jaunty

This comment, and the following, look wrong.

[2]
+class ReleaseUpgraderConfiguration(PackageTaskHandlerConfiguration):
+ """Specialized configuration for the Landscape package-reporter."""

It seems to be the release upgrade configuration.

[3]
+ if os.getuid() == 0:
+ os.setgid(grp.getgrnam("landscape").gr_gid)
+ os.setuid(pwd.getpwnam("landscape").pw_uid)
+
+ reporter = find_reporter_command()
+
+ # Force a smart-update run, because the sources.list has changed
+ args = ["--force-smart-update"]
+
+ if self._config.config is not None:
+ args.append("--config=%s" % self._config.config)
+

As discussed, this code should be shared with the changer, possibly switching to use the uid/gid arguments to reactor.spawnProcess.

I didn't test the branch functionally, but it looked good. +1!

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Thanks for reviewing, Thomas!

[1], [2]

Oops, fixed.

[3]

I implemented the change for the ReleaseUpgrader, I'm going to open a ticket to eventually have the PackageChanger share the same code.

Revision history for this message
Jamu Kakar (jkakar) wrote :

[1]

I have a test failure (I don't have a 'landscape' group on this
machine):

[ERROR]: landscape.tests.subunit.RemotedTestCase.test_finish_as_root

Traceback (most recent call last):
Failure: landscape.tests.subunit.RemoteException: Traceback (most recent call last):
  File "/home/jkakar/src/projects/twisted/trunk/twisted/internet/defer.py", line 102, in maybeDeferred
    result = f(*args, **kw)
  File "/home/jkakar/src/projects/twisted/trunk/twisted/internet/utils.py", line 191, in runWithWarningsSuppressed
    result = f(*a, **kw)
  File "/home/jkakar/src/free/landscape-client/release-upgrader/landscape/tests/mocker.py", line 102, in test_method_wrapper
    result = test_method()
  File "/home/jkakar/src/free/landscape-client/release-upgrader/landscape/package/tests/test_releaseupgrader.py", line 318, in test_finish_as_root
    setgid_mock(grp.getgrnam("landscape").gr_gid)
KeyError: 'getgrnam(): name not found: landscape'

This branch looks great. I haven't functionally tested it, but +1
on the code changes.

tags: removed: review
Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Thanks Jamu!

[1]

Are you sure you're reviewing the branch with the fixes from Thomas' comments? My line 318 in test_finish_as_root looks different, and that code isn't there anymore.

Out of curiosity, do you have a recent version of the landscape-client package installed on this system? The landscape group should be created by default, since July I'd say.

Changed in landscape-client:
status: In Progress → Fix Committed
tags: added: needs-testing
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Code confirmed in staging, and dist-upgrades tested.

tags: removed: needs-testing
Jamu Kakar (jkakar)
tags: added: 1.5-upgrade-client
Changed in landscape-client (Ubuntu Lucid):
status: New → Fix Committed
Changed in landscape-client (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

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
Revision history for this message
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 Karmic):
status: New → Fix Committed
Revision history for this message
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!

Revision history for this message
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
Revision history for this message
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
Revision history for this message
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
Changed in landscape-client:
status: Fix Committed → Fix Released
tags: removed: verification-needed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.