← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1508271] [NEW] specified cidr=129.168.0.0 in creating subnet, no message to be showed

 

Public bug reported:

in creating subnet workflows, filled in all fields,but set network address is 129.168.0.0,and ip version is ipv4,then click button "Next",
there is nothing to be done.But in the function of _check_subnet_data,it will raise an error,"The subnet in the Network Address is "
too small " should be showed.By the way,the values of the fields when creating a subnet in error.bmp.the function of _check_subnet_data as follows:

def _check_subnet_data(self, cleaned_data, is_create=True):
        cidr = cleaned_data.get('cidr')
        ip_version = int(cleaned_data.get('ip_version'))
        gateway_ip = cleaned_data.get('gateway_ip')
        no_gateway = cleaned_data.get('no_gateway')

        if not cidr:
            raise forms.ValidationError(self.msg)
        if cidr:
            subnet = netaddr.IPNetwork(cidr)

            if subnet.version != ip_version:
                msg = _('Network Address and IP version are inconsistent.')
                raise forms.ValidationError(msg)
            if (ip_version == 4 and subnet.prefixlen == 32) or \
                    (ip_version == 6 and subnet.prefixlen == 128):
                msg = _("The subnet in the Network Address is "
                        "too small (/%s).") % subnet.prefixlen   
                raise forms.ValidationError(msg)
        if not no_gateway and gateway_ip:
            if netaddr.IPAddress(gateway_ip).version is not ip_version:
                msg = _('Gateway IP and IP version are inconsistent.')
                raise forms.ValidationError(msg)
        if not is_create and not no_gateway and not gateway_ip:
            msg = _('Specify IP address of gateway or '
                    'check "Disable Gateway".')
            raise forms.ValidationError(msg)

** Affects: horizon
     Importance: Undecided
         Status: New

** Attachment added: "error.bmp"
   https://bugs.launchpad.net/bugs/1508271/+attachment/4501510/+files/error.bmp

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1508271

Title:
  specified cidr=129.168.0.0 in creating subnet,no message to be showed

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  in creating subnet workflows, filled in all fields,but set network address is 129.168.0.0,and ip version is ipv4,then click button "Next",
  there is nothing to be done.But in the function of _check_subnet_data,it will raise an error,"The subnet in the Network Address is "
  too small " should be showed.By the way,the values of the fields when creating a subnet in error.bmp.the function of _check_subnet_data as follows:

  def _check_subnet_data(self, cleaned_data, is_create=True):
          cidr = cleaned_data.get('cidr')
          ip_version = int(cleaned_data.get('ip_version'))
          gateway_ip = cleaned_data.get('gateway_ip')
          no_gateway = cleaned_data.get('no_gateway')

          if not cidr:
              raise forms.ValidationError(self.msg)
          if cidr:
              subnet = netaddr.IPNetwork(cidr)

              if subnet.version != ip_version:
                  msg = _('Network Address and IP version are inconsistent.')
                  raise forms.ValidationError(msg)
              if (ip_version == 4 and subnet.prefixlen == 32) or \
                      (ip_version == 6 and subnet.prefixlen == 128):
                  msg = _("The subnet in the Network Address is "
                          "too small (/%s).") % subnet.prefixlen   
                  raise forms.ValidationError(msg)
          if not no_gateway and gateway_ip:
              if netaddr.IPAddress(gateway_ip).version is not ip_version:
                  msg = _('Gateway IP and IP version are inconsistent.')
                  raise forms.ValidationError(msg)
          if not is_create and not no_gateway and not gateway_ip:
              msg = _('Specify IP address of gateway or '
                      'check "Disable Gateway".')
              raise forms.ValidationError(msg)

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1508271/+subscriptions


Follow ups