SirLagz / TelstraSMS.py

A Python script to access Telstra SMS API
0 stars 1 forks source link

new authtoken #1

Closed getabc closed 9 years ago

getabc commented 9 years ago

Hello,

If there is an empty "/tmp/telstraauth" auth token file the script fails.

root@control:/usr/lib/zabbix/alertscripts# ./telstrasms.py xxxxxxxx Hello
Traceback (most recent call last):
  File "./telstrasms.py", line 24, in <module>
    dicttoken = json.loads(filetoken)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
SirLagz commented 9 years ago

I've added in some checks to check for invalid JSON now.

getabc commented 9 years ago

Thank you good sir :)

On Tue, Jul 21, 2015 at 6:05 PM, SirLagz notifications@github.com wrote:

I've added in some checks to check for invalid JSON now.

— Reply to this email directly or view it on GitHub https://github.com/SirLagz/TelstraSMS.py/issues/1#issuecomment-123287643 .