error: illegal IP address string passed to inet_aton

284 views
Skip to first unread message

sangareddy Reddy

unread,
Dec 20, 2014, 8:10:30 AM12/20/14
to robotframe...@googlegroups.com
I have a package with below defination:
def getip(hostIP):
        lng=ip2long(hostIP)
        ipaddr=socket.inet_ntoa(struct.pack('!L', lng))
        return ipaddr

and I am calling above def in the below txt file in robot framework, but IP address not getting passed in proper format and pybot throughing error illegal IP address, though passing legal IP address.
Library          lib.features.test
${device}       "10.1.1.1"
${output}=    getip    ${device} <------- this also wont work.
${output}=    getip    "10.1.1.1" <====== even this wont work

Please someone help with the above problem

Thanks in advance.

Mukesh T

unread,
Dec 20, 2014, 11:17:11 AM12/20/14
to robotframe...@googlegroups.com
Hi - Can you try passing the IP address without double quotes i.e. 10.1.1.1 (instead of "10.1.1.1") ?

Best,
Mukesh

Jerry Schneider

unread,
Dec 21, 2014, 8:40:39 PM12/21/14
to robotframe...@googlegroups.com
have you tried setting:
${device} =     Set Variable    ${10.1.1.1}
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

-- 
Linux registered user #475536
Ubuntu registered user #28583
Reply all
Reply to author
Forward
0 new messages