A bad CWOP server address no longer crashes the CWOP thread.

This commit is contained in:
Tom Keffer
2015-05-11 14:07:23 -07:00
parent 9556d18d77
commit 919a3af93a
3 changed files with 16 additions and 2 deletions

View File

@@ -1,6 +1,13 @@
TODO: items for the next release; complete list is at github
-------------------------------------------------------------------------------
Some inconsistencies on the "name" of a driver. In the User's Guide, it
tells you to set station_type to what is really the stanza name ---
something like FineOffsetUSB. However, the utility wee_config requires
you to specify the actual driver location, weewx.drivers.fousb.
Similar problem with extension names.
test deb upgrades
test wee_extension on deb system

View File

@@ -1050,8 +1050,13 @@ class CWOPThread(RESTThread):
# a connection that works:
for _serv_addr_str in self.server_list:
_server, _port_str = _serv_addr_str.split(":")
_port = int(_port_str)
try:
_server, _port_str = _serv_addr_str.split(":")
_port = int(_port_str)
except ValueError:
syslog.syslog(syslog.LOG_ALERT,
"restx: Bad CWOP server address: '%s'; ignoring..." % _serv_addr_str)
continue
# Try each combination up to max_tries times:
for _count in range(self.max_tries):

View File

@@ -50,6 +50,8 @@ decimal point.
Increased precision of barometer posts to WOW from 1 to 3 decimal points.
A bad CWOP server address no longer crashes the CWOP thread.
The "alarm" example now includes a try block to catch a NameError exception
should the alarm expression include a variable not in the archive record.