ia64/xen-unstable

changeset 14963:80c458bb1b6d

[XEND] Start cleanly even with bad xml state files

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
author Tom Wilkie <tom.wilkie@gmail.com>
date Fri Apr 27 10:44:11 2007 +0100 (2007-04-27)
parents c8e01cc58cb1
children 6548dadab8d5
files tools/python/xen/xend/XendNode.py
line diff
     1.1 --- a/tools/python/xen/xend/XendNode.py	Fri Apr 27 10:24:09 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendNode.py	Fri Apr 27 10:44:11 2007 +0100
     1.3 @@ -141,7 +141,10 @@ class XendNode:
     1.4          saved_networks = self.state_store.load_state('network')
     1.5          if saved_networks:
     1.6              for net_uuid, network in saved_networks.items():
     1.7 -                XendNetwork.recreate(network, net_uuid)
     1.8 +                try:
     1.9 +                    XendNetwork.recreate(network, net_uuid)
    1.10 +                except CreateUnspecifiedAttributeError:
    1.11 +                    log.warn("Error recreating network %s", net_uuid)
    1.12                  
    1.13          # Next discover any existing bridges and check
    1.14          # they are not already configured
    1.15 @@ -161,8 +164,11 @@ class XendNode:
    1.16          saved_pifs = self.state_store.load_state('pif')
    1.17          if saved_pifs:
    1.18              for pif_uuid, pif in saved_pifs.items():
    1.19 -                XendPIF.recreate(pif, pif_uuid)
    1.20 - 
    1.21 +                try:
    1.22 +                    XendPIF.recreate(pif, pif_uuid)
    1.23 +                except CreateUnspecifiedAttributeError:
    1.24 +                    log.warn("Error recreating PIF %s", pif_uuid)
    1.25 +        
    1.26          # Next discover any existing PIFs and check
    1.27          # they are not already configured
    1.28          configured_pifs = [XendAPIStore.get(
    1.29 @@ -217,7 +223,10 @@ class XendNode:
    1.30          saved_pbds = self.state_store.load_state('pbd')
    1.31          if saved_pbds:
    1.32              for pbd_uuid, pbd_cfg in saved_pbds.items():
    1.33 -                XendPBD.recreate(pbd_uuid, pbd_cfg)
    1.34 +                try:
    1.35 +                    XendPBD.recreate(pbd_uuid, pbd_cfg)
    1.36 +                except CreateUnspecifiedAttributeError:
    1.37 +                    log.warn("Error recreating PBD %s", pbd_uuid) 
    1.38  
    1.39  ##    def network_destroy(self, net_uuid):
    1.40   ##       del self.networks[net_uuid]