Merge lp:~xaba/ubuntu/natty/pytrainer/bug-760885 into lp:ubuntu/natty/pytrainer

Proposed by Xavier Bassery
Status: Merged
Merge reported by: Colin Watson
Merged at revision: not available
Proposed branch: lp:~xaba/ubuntu/natty/pytrainer/bug-760885
Merge into: lp:ubuntu/natty/pytrainer
Diff against target: 40 lines (+11/-4)
2 files modified
debian/changelog (+7/-0)
pytrainer/profile.py (+4/-4)
To merge this branch: bzr merge lp:~xaba/ubuntu/natty/pytrainer/bug-760885
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Approve
Ubuntu branches Pending
Review via email: mp+58908@code.launchpad.net

Description of the change

Small fix to LP #760885 that renders the application unusable if no configuration file is found or if it is empty.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Thanks for your patch Xavier! This seems like a reasonable fix to me. I have two questions:

* Should the log message be changed to indicate that a default configuration is going to be used?

* Now that Natty has been released, is this fix important enough to put through the SRU process?

https://wiki.ubuntu.com/StableReleaseUpdates

review: Approve
Revision history for this message
Brian Murray (brian-murray) wrote :

The application fails to start without a configuration file after being freshly installed so I think that is important enough to put through the SRU process.

Revision history for this message
Brian Murray (brian-murray) wrote :

I uploaded this to natty-proposed.

Revision history for this message
Xavier Bassery (xaba) wrote :

It is my pleasure Barry!
Regarding your first question, you are right that a log message should inform that a default configuration will be used.
I have added that in a new revision.

12. By Xavier Bassery

log the defaut profile creation when none exists.

Revision history for this message
Daniel Holbach (dholbach) wrote :

All these changes have gone into -updates already. Can this merge proposal please be marked as 'merged'?

Revision history for this message
Colin Watson (cjwatson) wrote :

<dholbach> cjwatson, can you also mark this one as merged https://code.launchpad.net/~xaba/ubuntu/natty/pytrainer/bug-760885/+merge/58908? seems it got into natty-proposed and -updates already
<cjwatson> dholbach: the new revision mentioned at the end of the comment thread too?
<dholbach> cjwatson, hum, looks like not - I'll follow up on the merge proposal
<dholbach> cjwatson, oh no, it's included - it's just not documented in d/changelog

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-10-16 15:13:54 +0000
3+++ debian/changelog 2011-05-02 01:49:25 +0000
4@@ -1,3 +1,10 @@
5+pytrainer (1.7.2-1.1ubuntu2) natty; urgency=low
6+
7+ * Workaround bug (LP: #760885) to let the application start even if the
8+ user configuration file is not found.
9+
10+ -- Xavier Bassery <xavier@bartica.org> Sun, 24 Apr 2011 00:12:48 +0200
11+
12 pytrainer (1.7.2-1.1ubuntu1) natty; urgency=low
13
14 * Merge from debian unstable (LP: #599457), remaining changes:
15
16=== modified file 'pytrainer/profile.py'
17--- pytrainer/profile.py 2010-05-12 15:33:22 +0000
18+++ pytrainer/profile.py 2011-05-02 01:49:25 +0000
19@@ -35,9 +35,9 @@
20 self.configuration = XMLParser(self.filename)
21 # Checks if configuration file is empty
22 if self.configuration.xmldoc is None:
23- logging.error("Seems no data available in local configuration file: "+self.filename+", please check")
24- logging.error("Fatal error, exiting")
25- exit(-3)
26+ logging.warning("Seems no data available in local configuration file: "+self.filename+", please check")
27+ logging.info("A default profile will be created")
28+ self.createDefaultConf()
29 else:
30 logging.debug("Configuration retrieved: "+str(self.configuration.getOptions()))
31 logging.debug("<<")
32@@ -82,7 +82,7 @@
33 logging.debug("Retrieving data from "+ self.filename)
34 self.configuration = XMLParser(self.filename)
35 #list_options.append(("version",self.version))
36- if not os.path.isfile(self.filename):
37+ if not os.path.isfile(self.filename) or os.stat(self.filename).st_size == 0:
38 self.configuration.createXMLFile("pytraining",list_options)
39 for option in list_options:
40 logging.debug("Adding "+option[0]+"|"+option[1])

Subscribers

People subscribed via source and target branches