A script for dynamically updating a GoDaddy DNS record. I use GoDaddy to host DNS for a domain and I wanted to point an A record in that domain to a host who's IP address changes occasionally. GoDaddy has an API to do this, so this happened. Cf. thatjpk/cloudflare-ddns.
Traceback (most recent call last):
File "/root/godaddy_updater.py", line 141, in
main()
File "/root/godaddy_updater.py", line 84, in main
with urlopen("http://ipv4.icanhazip.com/") as f: resp=f.read()
AttributeError: addinfourl instance has no attribute 'exit'
[root@padin ~]#
That is probably an effect of the version of python used. In Python 3, urlopen() returns a context handler which can be used with 'with'. In at least some versions of Python 2, it doesn't. For a discussion with respect to 2.7 only, see here.
I am now getting this error after going to Centos7
[root@padin ~]# /root/godaddy_updater.py %/root/godaddy-ddns.config
Traceback (most recent call last): File "/root/godaddy_updater.py", line 141, in
main()
File "/root/godaddy_updater.py", line 84, in main
with urlopen("http://ipv4.icanhazip.com/") as f: resp=f.read()
AttributeError: addinfourl instance has no attribute 'exit'
[root@padin ~]#