CORD-1826: Do not sync app if waiting on autoconfig
Change-Id: I2d78ef94113919ea5b8d32ce44d8ac7d9a6d102c
(cherry picked from commit e154d3852d65c9b9987e7e59a68b4eb01c2a5edb)
diff --git a/xos/synchronizer/steps/sync_onosapp.py b/xos/synchronizer/steps/sync_onosapp.py
index c8084d1..fe10d6c 100644
--- a/xos/synchronizer/steps/sync_onosapp.py
+++ b/xos/synchronizer/steps/sync_onosapp.py
@@ -24,6 +24,7 @@
import json
from collections import OrderedDict
from xosconfig import Config
+from synchronizers.new_base.syncstep import DeferredException
from synchronizers.new_base.ansible_helper import run_template
from synchronizers.new_base.SyncInstanceUsingAnsible import SyncInstanceUsingAnsible
from synchronizers.new_base.modelaccessor import *
@@ -134,6 +135,11 @@
attrs = o.owner.serviceattribute_dict
attrs.update(o.tenantattribute_dict)
+ # Check to see if we're waiting on autoconfig
+ if (attrs.get("autogenerate") in ["vtn-network-cfg",]) and \
+ (not attrs.get("rest_onos/v1/network/configuration/")):
+ raise DeferredException("Network configuration is not populated yet")
+
ordered_attrs = attrs.keys()
onos = self.get_onos_service(o)