From 3cb5d4e4aabe46573d37be368d76546fe2e94893 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 5 Aug 2010 14:49:21 +0000 Subject: [PATCH] -Fix esx problem where network_prereqs would not successfully acquire data about newly created host bridges, it may take 1 to 2 seconds git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6986 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index b654e5c0f..2b8101d34 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -2404,15 +2404,17 @@ sub validate_network_prereqs { } $netsys->AddPortGroup(portgrp=>$hostgroupdef); #$hyphash{$hyp}->{nets}->{$netname}=1; - $hostview->update_view_data(); #pull in changes induced by previous activity - if (defined $hostview->{network}) { #We load the new object references - foreach (@{$hostview->network}) { - my $nvw = $hypconn->get_view(mo_ref=>$_); - if (defined $nvw->name) { - $hyphash{$hyp}->{nets}->{$nvw->name}=$_; + while ((not defined $hyphash{$hyp}->{nets}->{$pgname}) and sleep 1) { #we will only sleep if we know something will be waiting for + $hostview->update_view_data(); #pull in changes induced by previous activity + if (defined $hostview->{network}) { #We load the new object references + foreach (@{$hostview->network}) { + my $nvw = $hypconn->get_view(mo_ref=>$_); + if (defined $nvw->name) { + $hyphash{$hyp}->{nets}->{$nvw->name}=$_; + } } } - } + } #end while loop } } }