Support upgrade-tool environment variables

Bug #463321 reported by Free Ekanayaka on 2009-10-29
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 upgrade-tool supports two useful environment variables, namely
DEBUG_UPDATE_MANAGER and RELEASE_UPRADER_ALLOW_THIRD_PARTY.

If set to "True" they enable respectively debug logging and support for
non-official mirrors in APT sources.list, which won't get disabled
during the upgrade.

We should expose them to the user via the Landscape UI.

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

Free Ekanayaka (free.ekanayaka) wrote :

The attached branch implements the client side of the feature, I'm going to open another bug for the UI part.

affects: landscape → landscape-client
Changed in landscape-client:
milestone: 1.4.1 → none
milestone: none → 1.4.1
visibility: private → public
tags: added: review
Duncan McGreggor (oubiwann) wrote :

[1] As discussed on IRC, I'm getting an error (on Intrepid) when running the test suite:

===============================================================================
[FAIL]: landscape.tests.subunit.RemotedTestCase.test_upgrade_with_env_variables

Traceback (most recent call last):
Failure: landscape.tests.subunit.RemoteException: Traceback (most recent call last):
  File "/home/oubiwann/lab/Twisted/trunk/twisted/internet/defer.py", line 326, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  File "/tmp/merge_test/landscape/package/tests/test_releaseupgrader.py", line 257, in check_result
    "result-code": 0}])
  File "/tmp/merge_test/landscape/tests/helpers.py", line 76, in assertMessages
    self.assertMessage(obtained_message, expected_message)
  File "/tmp/merge_test/landscape/tests/helpers.py", line 70, in assertMessage
    pprint.pformat(obtained)))
FailTest: Messages don't match.
Expected:
{'operation-id': 100,
 'result-code': 0,
 'result-text': u'DEBUG_UPDATE_MANAGER=True\nRELEASE_UPRADER_ALLOW_THIRD_PARTY=True\n',
 'status': 6,
 'type': 'operation-result'}
Obtained:
{'operation-id': 100,
 'result-code': 0,
 'result-text': u'DEBUG_UPDATE_MANAGER=True\nRELEASE_UPRADER_ALLOW_THIRD_PARTY=True\nSHLVL=1\n_=/usr/bin/env\n',
 'status': 6,
 'type': 'operation-result'}

===============================================================================

With a test tweak, +1

Duncan McGreggor (oubiwann) wrote :

Hrm, it looks like this test failure in trunk might benefit from a similar fix:

[2]

===============================================================================
[FAIL]: landscape.tests.subunit.RemotedTestCase.test_upgrade

Traceback (most recent call last):
Failure: landscape.tests.subunit.RemoteException: Traceback (most recent call last):
  File "/home/oubiwann/lab/Twisted/trunk/twisted/internet/defer.py", line 326, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  File "/home/oubiwann/lab/Canonical/Landscape/client/trunk/landscape/package/tests/test_releaseupgrader.py", line 216, in check_result
    "result-code": 0}])
  File "/home/oubiwann/lab/Canonical/Landscape/client/trunk/landscape/tests/helpers.py", line 76, in assertMessages
    self.assertMessage(obtained_message, expected_message)
  File "/home/oubiwann/lab/Canonical/Landscape/client/trunk/landscape/tests/helpers.py", line 70, in assertMessage
    pprint.pformat(obtained)))
FailTest: Messages don't match.
Expected:
{'operation-id': 100,
 'result-code': 0,
 'result-text': u'--frontend DistUpgradeViewNonInteractive\nFOO=bar\nPWD=/tmp/tmpS5SGYi/package/upgrade-tool\nout\n',
 'status': 6,
 'type': 'operation-result'}
Obtained:
{'operation-id': 100,
 'result-code': 0,
 'result-text': u'--frontend DistUpgradeViewNonInteractive\nFOO=bar\nPWD=/tmp/tmpS5SGYi/package/upgrade-tool\nSHLVL=1\n_=/usr/bin/env\nout\n',
 'status': 6,
 'type': 'operation-result'}

===============================================================================

Thomas Herve (therve) wrote :

[1]
         @param code_name: The code-name of the release to upgrade to.
+ @param allow_third_party: Whether to enable non-official APT repo.
+ @param debug: Whether to turn on debug level logging.
+ @param code_name: The code-name of the release to upgrade to.

The docstring for code_name is duplicated.

[2]
+ def cleanup(ignored):
+ os.environ = env_backup
+ return ignored
+
+ deferred.addBoth(cleanup)

I think you don't need that as you're using EnvironSaverHelper.

+1!

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

Thanks Duncan and Thomas, all comments addressed.

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

Code confirmed in staging.

tags: removed: needs-testing
Jamu Kakar (jkakar) on 2009-12-16
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

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 Karmic):
status: New → Fix Committed
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!

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
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  Edit
Everyone can see this information.

Other bug subscribers