Although it is guarded with try/except, instead of checking for online state it still solves the problem:
revno: 5528
committer: Mario Limonciello <email address hidden>
branch nick: ubiquity
timestamp: Wed 2012-06-27 19:21:51 -0500
message:
Don't let oem-config crash from an invalid server return on the timezone
page.
diff:
=== modified file 'debian/changelog'
--- debian/changelog 2012-06-27 21:46:17 +0000
+++ debian/changelog 2012-06-28 00:21:51 +0000
@@ -4,6 +4,10 @@
* Only allow a user to proceed on the networking screen if he entered a valid
password. This prevents a nm dbus exception. (LP: #112211)
+ [ Mario Limonciello ]
+ * Don't let oem-config crash from an invalid server return on the timezone
+ page.
+
-- Stéphane Graber <email address hidden> Wed, 27 Jun 2012 17:45:36 -0400
ubiquity (2.11.7) quantal-proposed; urgency=low
=== modified file 'ubiquity/plugins/ubi-timezone.py'
--- ubiquity/plugins/ubi-timezone.py 2012-05-29 23:07:53 +0000
+++ ubiquity/plugins/ubi-timezone.py 2012-06-28 00:21:51 +0000
@@ -176,15 +176,19 @@ (text, message.status_code, message.reason_phrase))))
else:
- for result in json.loads(message.response_body.data):
- model.append([result['name'],
- result['admin1'],
- result['country'],
- result['latitude'],
- result['longitude']])
-
- # Only cache positive results.
- self.geoname_cache[text] = model
+ try:
+ for result in json.loads(message.response_body.data):
+ model.append([result['name'],
+ result['admin1'],
+ result['country'],
+ result['latitude'],
+ result['longitude']])
+
+ # Only cache positive results.
+ self.geoname_cache[text] = model
+
+ except ValueError:
+ syslog.syslog('Server return does not appear to be valid JSON.')
Although it is guarded with try/except, instead of checking for online state it still solves the problem:
revno: 5528
committer: Mario Limonciello <email address hidden>
branch nick: ubiquity
timestamp: Wed 2012-06-27 19:21:51 -0500
message:
Don't let oem-config crash from an invalid server return on the timezone
page.
diff:
=== modified file 'debian/changelog'
--- debian/changelog 2012-06-27 21:46:17 +0000
+++ debian/changelog 2012-06-28 00:21:51 +0000
@@ -4,6 +4,10 @@
* Only allow a user to proceed on the networking screen if he entered a valid
password. This prevents a nm dbus exception. (LP: #112211)
+ [ Mario Limonciello ]
+ * Don't let oem-config crash from an invalid server return on the timezone
+ page.
+
-- Stéphane Graber <email address hidden> Wed, 27 Jun 2012 17:45:36 -0400
ubiquity (2.11.7) quantal-proposed; urgency=low
=== modified file 'ubiquity/ plugins/ ubi-timezone. py' plugins/ ubi-timezone. py 2012-05-29 23:07:53 +0000 plugins/ ubi-timezone. py 2012-06-28 00:21:51 +0000
(text, message. status_ code,
message. reason_ phrase) ))) message. response_ body.data) : [result[ 'name'] , 'longitude' ]]) cache[text] = model message. response_ body.data) : [result[ 'name'] , 'longitude' ]]) cache[text] = model syslog( 'Server return does not appear to be valid JSON.')
--- ubiquity/
+++ ubiquity/
@@ -176,15 +176,19 @@
else:
- for result in json.loads(
- model.append(
- result['admin1'],
- result['country'],
- result['latitude'],
- result[
-
- # Only cache positive results.
- self.geoname_
+ try:
+ for result in json.loads(
+ model.append(
+ result['admin1'],
+ result['country'],
+ result['latitude'],
+ result[
+
+ # Only cache positive results.
+ self.geoname_
+
+ except ValueError:
+ syslog.