CORD-2275: Use defer_sync instead of sleep to retry with a delay

Change-Id: Ib68e58622dd4212a532a27ac8fc7a62a344e0c19
(cherry picked from commit f992f4b03f29f5b6a566b16122cbd5cb9b08d5da)
diff --git a/xos/synchronizer/steps/sync_vspgwctenant.py b/xos/synchronizer/steps/sync_vspgwctenant.py
index 6de5068..015c851 100644
--- a/xos/synchronizer/steps/sync_vspgwctenant.py
+++ b/xos/synchronizer/steps/sync_vspgwctenant.py
@@ -217,15 +217,11 @@
         internetemulator_flag = self.has_internetemulator()
 
         # wait until vspgwu and env are comming up
-        while (not vspgwu_flag):
-            print "wait -- vSPGWU has not been comming up"
-            time.sleep(1)
-            vspgwu_flag = self.has_vspgwu()
-
-        while (not venb_flag):
-            print "wait -- vENB has not been comming up"
-            time.sleep(1)
-            venb_flag = self.has_venb()
+        if (not vspgwu_flag):
+            self.defer_sync("Waiting for vSPGWU to come up")
+            
+        if (not venb_flag):
+            self.defer_sync("Waiting for vENB to come up")
 
         if vmme_flag and venb_flag and sdncontroller_flag and vspgwu_flag and internetemulator_flag:
             return 'normal_scenario'
@@ -255,6 +251,7 @@
             except Exception:
                 ip_address = "error"
                 self.log.error('Could not fetch parameter', parameter = parameter, network_name = network_name)
+                self.defer_sync("Waiting for parameters to become available")
 
         return ip_address