Foreword:
This is not an attempt to continue discussing whether it is evil to contact Google.com in order to make sure an internet connection is available.
This post is intended to explain why the command urlopen("<name of website>") must not be removed from mintupdate.py.
References:
- Thread [url=http://forums.linuxmint.com/viewtopic.php?f=90&t=145176]Steady Info to Google - hardcoded in Linux Mint ?![/url] in general. [url=http://forums.linuxmint.com/viewtopic.php?f=90&t=145176#p764963]Your reply at the end of page 1 in particular[/url].
- Posted mintUpdate fix on Github: Only use ping_domain to check connection, don't rely on pinging google.com …
Code: Select all
url=urlopen("http://google.com")
Well, I can tell you why. And I can tell why the address may be changed using the address got from the mintupdate dialog box (prefs["ping_domain"]), but why the whole code block is needed :
Code: Select all
try:
from urllib import urlopen
url=urlopen("prefs["ping_domain"]") <== what ever the right python code will be to get it there, prefixed with http://
url.read()
url.close()
log.writelines("++ Connection to the Internet successful (tried to read http://www.google.com)\n")
- urlopen("<name of website>") can be used no matter whether the user is connected through a DSL router or through a proxy.
- if os.system("ping " + prefs["ping_domain"] + " -c1 -q"): can be used from my home machine connected through a DSL router.
But our company proxy server e.g. will discard ping commands to the internet making the command always fail. - Consequence:
Currently mintupdate succeeds on my office machine, because urlopen("<name of webpage>") will pass the proxy.
With the suggested fix mintupdate will always fail on any machine behind a proxy that drops ping commands. - Conclusion:
The proper fix will be to keep the code block, but to make sure it uses "http://" + prefs["ping_domain"]" instead of "http://google.com".
Kind regards,
Karl