ia64/xen-unstable

changeset 7178:625c75a223fe

Cope with missing configuration information inside the configuration method.
This allows us to better recover if the store has been deleted.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Tue Oct 04 02:28:41 2005 +0100 (2005-10-04)
parents 7f42935cb4b0
children 549325dfa161 a6154af4fc43
files tools/python/xen/xend/server/blkif.py tools/python/xen/xend/server/netif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/blkif.py	Tue Oct 04 02:25:04 2005 +0100
     1.2 +++ b/tools/python/xen/xend/server/blkif.py	Tue Oct 04 02:28:41 2005 +0100
     1.3 @@ -69,8 +69,10 @@ class BlkifController(DevController):
     1.4                                                    'dev', 'type', 'params',
     1.5                                                    'read-only')
     1.6  
     1.7 -        result.append(['dev', dev])
     1.8 -        result.append(['uname', typ + ":" + params])
     1.9 +        if dev:
    1.10 +            result.append(['dev', dev])
    1.11 +        if typ and params:
    1.12 +            result.append(['uname', typ + ":" + params])
    1.13          if ro:
    1.14              result.append(['mode', 'r'])
    1.15          else:
     2.1 --- a/tools/python/xen/xend/server/netif.py	Tue Oct 04 02:25:04 2005 +0100
     2.2 +++ b/tools/python/xen/xend/server/netif.py	Tue Oct 04 02:28:41 2005 +0100
     2.3 @@ -80,11 +80,15 @@ class NetifController(DevController):
     2.4                                                       'script', 'ip', 'bridge',
     2.5                                                       'mac')
     2.6  
     2.7 -        result.append(['script',
     2.8 -                       script.replace(xroot.network_script_dir + os.sep, "")])
     2.9 +        if script:
    2.10 +            result.append(['script',
    2.11 +                           script.replace(xroot.network_script_dir + os.sep,
    2.12 +                                          "")])
    2.13          if ip:
    2.14              result.append(['ip', ip.split(" ")])
    2.15 -        result.append(['bridge', bridge])
    2.16 -        result.append(['mac', mac])
    2.17 +        if bridge:
    2.18 +            result.append(['bridge', bridge])
    2.19 +        if mac:
    2.20 +            result.append(['mac', mac])
    2.21  
    2.22          return result