ia64/xen-unstable

changeset 13731:bca858b72bf8

[XEND] Unparsable VLAN numbers should default to -1

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Tue Jan 30 11:37:18 2007 +0000 (2007-01-30)
parents fe02bdd43ac1
children 5165b7ecbff5 0a28ad8cedf2
files tools/python/xen/xend/XendNode.py tools/python/xen/xend/XendPIF.py
line diff
     1.1 --- a/tools/python/xen/xend/XendNode.py	Tue Jan 30 11:14:23 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendNode.py	Tue Jan 30 11:37:18 2007 +0000
     1.3 @@ -125,8 +125,13 @@ class XendNode:
     1.4                              # Compatibility hack, can go pretty soon.
     1.5                              pif['metrics'] = uuid.createString()
     1.6  
     1.7 +                        try:
     1.8 +                            pif['VLAN'] = int(pif.get('VLAN', -1))
     1.9 +                        except (ValueError, TypeError):
    1.10 +                            pif['VLAN'] = -1
    1.11 +
    1.12                          self._PIF_create(pif['device'], pif['MTU'],
    1.13 -                                         int(pif['VLAN']),
    1.14 +                                         pif['VLAN'],
    1.15                                           pif['MAC'], network, False, pif_uuid,
    1.16                                           pif['metrics'])
    1.17                      except NetworkAlreadyConnected, exn:
     2.1 --- a/tools/python/xen/xend/XendPIF.py	Tue Jan 30 11:14:23 2007 +0000
     2.2 +++ b/tools/python/xen/xend/XendPIF.py	Tue Jan 30 11:37:18 2007 +0000
     2.3 @@ -138,8 +138,9 @@ class XendPIF:
     2.4              
     2.5              rc, _ = _cmd('vconfig add %s %d', self.device, self.vlan)
     2.6              if rc != 0:
     2.7 -                log.error('Could not refresh %s', ifname)
     2.8 +                log.error('Could not refresh VLAN for interface %s', ifname)
     2.9                  return
    2.10 +            
    2.11              log.info('Created network interface %s', ifname)
    2.12  
    2.13          for brname, nics in bridges.items():