kevingill1966 / vavista-rpc

RPC access to VA VistA (using FMQL implementation)
1 stars 4 forks source link

socket_gaierror #1

Open rmurray1 opened 9 years ago

rmurray1 commented 9 years ago

When I try to use the vavista-rpc through the VA firewall or over wifi get the following error:

CTX-LTA117851:Scripts vhantxmurrar$ python testVcon.py Traceback (most recent call last): File "testVcon.py", line 25, in print c.invoke("XWB EGCHO STRING", "THIS IS A STRING") File "/Library/Python/2.7/site-packages/vavista_rpc-1.0a1-py2.7.egg/vavista/rpc/brokerRPCLocal.py", line 140, in invoke rv = self.invokeRPC(name, params) File "/Library/Python/2.7/site-packages/vavista_rpc-1.0a1-py2.7.egg/vavista/rpc/brokerRPC.py", line 94, in invokeRPC self.connect() File "/Library/Python/2.7/site-packages/vavista_rpc-1.0a1-py2.7.egg/vavista/rpc/brokerRPC.py", line 192, in connect tcpConnect = self.makeRequest("TCPConnect", [socket.gethostbyname(socket.gethostname()), "0", "FMQL"], True) socket.gaierror: [Errno 8] nodename nor servname provided, or not known

rmurray1 commented 9 years ago

I was able to make the following change to the brokerRPC.py to get the connection to work on Mac OS X if socket.gethostname().find('.')>=0: hostname=socket.gethostname() else: hostname=socket.gethostbyaddr(socket.gethostname())[0] tcpConnect = self.makeRequest("TCPConnect", [hostname, "0", "FMQL"], True)