[PLUG] python boggle

Russell Johnson russ at dimstar.net
Thu Jul 25 18:49:28 UTC 2013


I'm trying to read the content of a file to specify the name of a server to a python script. If I set the variable directly, it works fine If I read the file, the script fails with a 'can't find server' error. 

Setting the hostname directly is easy enough:

SERVER_NAME = fqdn.domain.net

That works fine... Adding a print to the script prints the appropriate hostname.

If, however, I try to read the filename from a file, I get what amounts to a host not found error:

f1 = open('/path/to/file', 'r')

SERVER_NAME = f1.read()
f1.closed

And again, printing the variable prints the correct hostname, but when the script attempts to access the host, it can't find the host. 

Ideas? 

Russell Johnson
russ at dimstar.net






More information about the PLUG mailing list