Issue52 - firewall input plugin and ACL addresses

Firewalling plus extra tests to keep at 100% code coverage.

OK, fixed that one.

From: Cory Benfield [mailto:notifications@github.com]
Sent: 08 December 2014 17:08
To: Metaswitch/calico
Cc: Peter White
Subject: Re: [calico] Issue52 - firewall input plugin and ACL addresses (#60)


In calico/felix/config.py:

> @@ -175,3 +178,28 @@ def warn_unused_cfg(self):

>              for lKey in self._items[section].keys():

>                  log.warning("Got unexpected item %s=%s in %s" %

>                               (lKey, self._items[section][lKey], self._config_path))

> +

> +    def validate_addr(self, name, addr):

> +        """

> +        Validate an address, returning the IP address it resolves to. If the

> +        address cannot be resolved then an exception is returned.

> +

> +        Parameters :

> +        - name of the field, for use in logging

> +        - address to resolve

> +        """

> +        try:

> +            stripped_addr = addr.strip()

> +            if not stripped_addr:

> +                raise ConfigException("Blank %s value : %s" % (name, addr),

Think we probably don't need to log addr here, seeing as it's all LWS.

—
Reply to this email directly or view it on GitHub<https://github.com/Metaswitch/calico/pull/60/files#r21467572>.