[Kimchi-devel] [PATCH v2] Issue #694: VLAN ID accepting only one digit

Paulo Ricardo Paz Vital pvital at linux.vnet.ibm.com
Mon Aug 31 20:24:15 UTC 2015


On Mon, 2015-08-31 at 17:14 -0300, Ramon Medeiros wrote:
> Changes:
> 
> v2:
> Correct Issue number on title
> 
> Verify vlan name size before adding it. If name greater than 15
> characters, display an error.
> 
> Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
> ---
>  src/kimchi/i18n.py           | 1 +
>  src/kimchi/model/networks.py | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
> index 862df7f..2f9c8d2 100644
> --- a/src/kimchi/i18n.py
> +++ b/src/kimchi/i18n.py
> @@ -257,6 +257,7 @@ messages = {
>      "KCHNET0020E": _("Failed to activate interface %(iface)s:
> %(err)s."),
>      "KCHNET0021E": _("Failed to activate interface %(iface)s. Please
> check the physical link status."),
>      "KCHNET0022E": _("Failed to start network %(name)s. Details:
> %(err)s"),
> +    "KCHNET0023E": _("Interface name %(name)s exceeds kernel limit 
> of 15 characters"),

Once you are working specifically with VLAN interface name, that it's
composed by other interface names, I guess would be better use the text
"VLAN interface name %(name)s exceeds kernel limit of 15 characters".

>      "KCHDR0001E": _("Debug report %(name)s does not exist"),
>      "KCHDR0002E": _("Debug report tool not found in system"),
> diff --git a/src/kimchi/model/networks.py
> b/src/kimchi/model/networks.py
> index 275e12b..03737d1 100644
> --- a/src/kimchi/model/networks.py
> +++ b/src/kimchi/model/networks.py
> @@ -216,6 +216,9 @@ class NetworksModel(object):
>          if br_name in bridges:
>              raise InvalidOperation("KCHNET0010E", {'iface':
> br_name})
> 
> +        if  len(br_name) > 15:
> +            raise InvalidOperation("KCHNET0023E", {'name': br_name})
> +
>          with RollbackContext() as rollback:
>              try:
>                  vlan_tagged_br = conn.interfaceDefineXML(br_xml, 0)




More information about the Kimchi-devel mailing list