Merge lp:~brian-murray/ubuntu-release-upgrader/bug-1302380 into lp:ubuntu-release-upgrader

Proposed by Brian Murray
Status: Merged
Merge reported by: Iain Lane
Merged at revision: not available
Proposed branch: lp:~brian-murray/ubuntu-release-upgrader/bug-1302380
Merge into: lp:ubuntu-release-upgrader
Diff against target: 61 lines (+14/-3)
4 files modified
DistUpgrade/DistUpgradeController.py (+3/-1)
DistUpgrade/DistUpgradeMain.py (+1/-1)
debian/changelog (+7/-0)
do-partial-upgrade (+3/-1)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-release-upgrader/bug-1302380
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Ubuntu Core Development Team Pending
Review via email: mp+214349@code.launchpad.net

Description of the change

This setups logging when doing partial-upgrade so that /var/log/dist-upgrade/ contains log files relevant to the partial upgrade.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Looks good, thanks!

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks again for this branch, I looked at this in more detail this morning and would like to use a slightly extended version of this work from here:
https://code.launchpad.net/~mvo/ubuntu-release-upgrader/partial-upgrade-cleanup/+merge/214685

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'DistUpgrade/DistUpgradeController.py'
2--- DistUpgrade/DistUpgradeController.py 2014-03-05 18:56:34 +0000
3+++ DistUpgrade/DistUpgradeController.py 2014-04-04 22:07:18 +0000
4@@ -1825,7 +1825,9 @@
5 self._view.processEvents()
6 return self.fullUpgrade()
7
8- def doPartialUpgrade(self):
9+ def doPartialUpgrade(self, config):
10+ from .DistUpgradeMain import setup_logging
11+ logdir = setup_logging(None, config)
12 " partial upgrade mode, useful for repairing "
13 self._view.setStep(STEP_PREPARE)
14 self._view.hideStep(STEP_MODIFY_SOURCES)
15
16=== modified file 'DistUpgrade/DistUpgradeMain.py'
17--- DistUpgrade/DistUpgradeMain.py 2013-07-11 17:49:30 +0000
18+++ DistUpgrade/DistUpgradeMain.py 2014-04-04 22:07:18 +0000
19@@ -101,7 +101,7 @@
20 shutil.move(f, os.path.join(backup_dir,os.path.basename(f)))
21 fname = os.path.join(logdir,"main.log")
22 # do not overwrite the default main.log
23- if options.partial:
24+ if options and options.partial:
25 fname += ".partial"
26 with open(fname, "a"):
27 pass
28
29=== modified file 'debian/changelog'
30--- debian/changelog 2014-03-28 22:29:01 +0000
31+++ debian/changelog 2014-04-04 22:07:18 +0000
32@@ -1,3 +1,10 @@
33+ubuntu-release-upgrader (1:0.219.3) UNRELEASED; urgency=medium
34+
35+ * When performing a partial upgrade setup_logging so that old log files are
36+ preversed (LP: #1302380)
37+
38+ -- Brian Murray <brian@ubuntu.com> Fri, 04 Apr 2014 14:46:44 -0700
39+
40 ubuntu-release-upgrader (1:0.219.2) trusty; urgency=medium
41
42 * DistUpgrade/DevelReleaseAnnouncement: Stop using "alpha" or "beta"
43
44=== modified file 'do-partial-upgrade'
45--- do-partial-upgrade 2012-06-28 19:22:04 +0000
46+++ do-partial-upgrade 2014-04-04 22:07:18 +0000
47@@ -34,6 +34,7 @@
48
49 from DistUpgrade.DistUpgradeVersion import VERSION
50 from DistUpgrade.DistUpgradeController import DistUpgradeController
51+from DistUpgrade.DistUpgradeConfigParser import DistUpgradeConfig
52 import locale
53 import gettext
54
55@@ -89,4 +90,5 @@
56 view.label_title.set_markup("<b><big>%s</big></b>" %
57 _("Running partial upgrade"))
58 controller = DistUpgradeController(view, datadir=data_dir)
59- controller.doPartialUpgrade()
60+ config = DistUpgradeConfig(data_dir)
61+ controller.doPartialUpgrade(config)

Subscribers

People subscribed via source and target branches