Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-19 Thread Daniel Flick
The problem was with the validation code. Within the python section of the template, the class IPv4Interface will throw an exception due to the invalid value during the validation process. Therefore, the server rejects the form data and the template is not created. Solution: It would work if y

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Daniel Flick
On Tuesday, October 17, 2017 at 8:24:52 PM UTC-5, Daniel Flick wrote: > On Tuesday, October 17, 2017 at 5:01:13 PM UTC-5, Peter Otten wrote: > > Daniel Flick wrote: > > > > > On Tuesday, October 17, 2017 at 4:25:02 PM UTC-5, Daniel Flick wrote: > > >> > > >> Peter, I am not following. Are you sa

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Daniel Flick
On Tuesday, October 17, 2017 at 8:27:03 PM UTC-5, Daniel Flick wrote: > On Tuesday, October 17, 2017 at 8:24:52 PM UTC-5, Daniel Flick wrote: > > On Tuesday, October 17, 2017 at 5:01:13 PM UTC-5, Peter Otten wrote: > > > Daniel Flick wrote: > > > > > > > On Tuesday, October 17, 2017 at 4:25:02 PM

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Daniel Flick
On Tuesday, October 17, 2017 at 5:01:13 PM UTC-5, Peter Otten wrote: > Daniel Flick wrote: > > > On Tuesday, October 17, 2017 at 4:25:02 PM UTC-5, Daniel Flick wrote: > >> > >> Peter, I am not following. Are you saying that there is a function that > >> returns the network only? network_address

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Peter Otten
Daniel Flick wrote: > On Tuesday, October 17, 2017 at 4:25:02 PM UTC-5, Daniel Flick wrote: >> >> Peter, I am not following. Are you saying that there is a function that >> returns the network only? network_address was giving me the mask >> attached to the end but maybe I was doing something wr

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Daniel Flick
On Tuesday, October 17, 2017 at 4:25:02 PM UTC-5, Daniel Flick wrote: > > Peter, I am not following. Are you saying that there is a function that > returns the network only? network_address was giving me the mask attached to > the end but maybe I was doing something wrong. > > For an input of

Re: Fwd: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Nathan Hilterbrand
Absolutely, Stefan! I like yours a lot better. I am an old perl hack that is still learning the ins and outs of Python, and this is just the sort of thing that I like to see. Thanks! On Tue, Oct 17, 2017 at 4:19 PM, Stefan Ram wrote: > Nathan Hilterbrand writes: > >I may have misunderstood w

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Daniel Flick
Peter, I am not following. Are you saying that there is a function that returns the network only? network_address was giving me the mask attached to the end but maybe I was doing something wrong. For an input of LAN_IP=192.168.99.1/24 ipaddress.IPv4Interface(LAN_IP).ip returns 192.168.99.0/

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Daniel Flick
I was hoping for something more like netaddr.network. Trying to save lots of code as this will be inside a Mako template and I don't want it to get messy. Sounds like the split function will allow me to chop off the /xx from the end of the string which gives me what I need. Off to read docu

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Daniel Flick
On Tuesday, October 17, 2017 at 12:37:03 PM UTC-5, Rob Gaddi wrote: > On 10/17/2017 09:59 AM, Daniel Flick wrote: > > I am very new to Python and have been struggling to find some info on > > processing IP addresses. > > > > get_network returns 192.168.1.128/25 but I need 192.168.1.128 only. I c

Fwd: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Nathan Hilterbrand
Hit wrong button before. -- Forwarded message -- From: Nathan Hilterbrand Date: Tue, Oct 17, 2017 at 2:22 PM Subject: Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25 To: Rob Gaddi I may have misunderstood what you were looking for

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Abdur-Rahmaan Janhangeer
any idea why this is on spam ? Abdur-Rahmaan Janhangeer, Mauritius abdurrahmaanjanhangeer.wordpress.com On 17 Oct 2017 21:00, "Daniel Flick" wrote: > I am very new to Python and have been struggling to find some info on > processing IP addresses. > > get_network returns 192.168.1.128/25 but I n

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Peter Otten
Daniel Flick wrote: > I am very new to Python and have been struggling to find some info on > processing IP addresses. > > get_network returns 192.168.1.128/25 but I need 192.168.1.128 only. I can > do this with netaddr but I am working with Mako templates and ipaddress is > a built in module so

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Rob Gaddi
On 10/17/2017 09:59 AM, Daniel Flick wrote: I am very new to Python and have been struggling to find some info on processing IP addresses. get_network returns 192.168.1.128/25 but I need 192.168.1.128 only. I can do this with netaddr but I am working with Mako templates and ipaddress is a bui

Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Daniel Flick
I am very new to Python and have been struggling to find some info on processing IP addresses. get_network returns 192.168.1.128/25 but I need 192.168.1.128 only. I can do this with netaddr but I am working with Mako templates and ipaddress is a built in module so there are less dependencies.