From: Andy Bavier Date: Mon, 19 Oct 2009 20:26:45 +0000 (+0000) Subject: Work around race condition when NodeManager is starting the vserver X-Git-Url: http://git.onelab.eu/?p=nodemanager-topo.git;a=commitdiff_plain;h=9ea45582b54387f99253307894e59ec5c6ddb176 Work around race condition when NodeManager is starting the vserver --- diff --git a/topo.py b/topo.py index be68831..b2beba5 100755 --- a/topo.py +++ b/topo.py @@ -405,11 +405,12 @@ def GetSlivers(data, config = None, plc = None): slicekeys[sliver['name']] = tag['value'] - if 'netns' in attrs: - netns = int(attrs['netns']) - else: - netns = 0 - write_conf_and_restart(sliver['name'], netns) + if vserver.VServer(sliver['name']).is_running(): + if 'netns' in attrs: + netns = int(attrs['netns']) + else: + netns = 0 + write_conf_and_restart(sliver['name'], netns) if vserver.VServer(sliver['name']).is_running(): if 'egre_key' in attrs: