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
=== modified file 'debian/changelog'
--- debian/changelog 2010-10-16 15:13:54 +0000
+++ debian/changelog 2011-05-02 01:49:25 +0000
@@ -1,3 +1,10 @@
1pytrainer (1.7.2-1.1ubuntu2) natty; urgency=low
2
3 * Workaround bug (LP: #760885) to let the application start even if the
4 user configuration file is not found.
5
6 -- Xavier Bassery <xavier@bartica.org> Sun, 24 Apr 2011 00:12:48 +0200
7
1pytrainer (1.7.2-1.1ubuntu1) natty; urgency=low8pytrainer (1.7.2-1.1ubuntu1) natty; urgency=low
29
3 * Merge from debian unstable (LP: #599457), remaining changes:10 * Merge from debian unstable (LP: #599457), remaining changes:
411
=== modified file 'pytrainer/profile.py'
--- pytrainer/profile.py 2010-05-12 15:33:22 +0000
+++ pytrainer/profile.py 2011-05-02 01:49:25 +0000
@@ -35,9 +35,9 @@
35 self.configuration = XMLParser(self.filename)35 self.configuration = XMLParser(self.filename)
36 # Checks if configuration file is empty36 # Checks if configuration file is empty
37 if self.configuration.xmldoc is None:37 if self.configuration.xmldoc is None:
38 logging.error("Seems no data available in local configuration file: "+self.filename+", please check")38 logging.warning("Seems no data available in local configuration file: "+self.filename+", please check")
39 logging.error("Fatal error, exiting")39 logging.info("A default profile will be created")
40 exit(-3)40 self.createDefaultConf()
41 else:41 else:
42 logging.debug("Configuration retrieved: "+str(self.configuration.getOptions()))42 logging.debug("Configuration retrieved: "+str(self.configuration.getOptions()))
43 logging.debug("<<")43 logging.debug("<<")
@@ -82,7 +82,7 @@
82 logging.debug("Retrieving data from "+ self.filename)82 logging.debug("Retrieving data from "+ self.filename)
83 self.configuration = XMLParser(self.filename)83 self.configuration = XMLParser(self.filename)
84 #list_options.append(("version",self.version))84 #list_options.append(("version",self.version))
85 if not os.path.isfile(self.filename):85 if not os.path.isfile(self.filename) or os.stat(self.filename).st_size == 0:
86 self.configuration.createXMLFile("pytraining",list_options)86 self.configuration.createXMLFile("pytraining",list_options)
87 for option in list_options:87 for option in list_options:
88 logging.debug("Adding "+option[0]+"|"+option[1])88 logging.debug("Adding "+option[0]+"|"+option[1])

Subscribers

People subscribed via source and target branches