Any idea why my view does not show the result of "ipaddress"?

On Fri, Aug 7, 2015 at 7:38 PM, Heinrich Piard <[email protected]>
wrote:

> Hi,
>
> I this default.py
>
> import os
> import sys
>
> def nslookup():
>     form = SQLFORM.factory(Field('hostname',
>                                  label='Please enter a valid HOSTNAME to
> resolve:',
>                                  requires=IS_NOT_EMPTY()))
>     if form.process().accepted:
>         response.flash = "Hostname accepted"
>         session.hostname = os.system("dig +short +time=1" + " " +
> request.vars.hostname)
>     else:
>         response.flash = 'Please fill the form with a valid hostname'
>     ipaddress = session.hostname
>     return dict(form=form, ipaddress=ipaddress)
>
> and respective nslookup.html
>
> {{extend 'layout.html'}}
> <h1>Domain Name Lookup Tool</h1>
>
> {{=form}}
>
> <h2>
>     Entered HOSTNAME has IP Address:
> </h2>
> {{=BEAUTIFY(ipaddress)}}
>
>
>
> However, the resolved IP does not work though I see the nslookup when
> doing a tcpdump.
>
> Any help would be appreciated.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to