+ # #######################################
+ # # Execute initial config primitive(s) #
+ # #######################################
+ primitives = {}
+
+ # Build a sequential list of the primitives to execute
+ for primitive in params['initial-config-primitive']:
+ try:
+ if primitive['name'] == 'config':
+ # This is applied when the Application is deployed
+ pass
+ else:
+ # TODO: We need to sort by seq, and queue the actions in order.
+
+ seq = primitive['seq']
+
+ primitives[seq] = {
+ 'name': primitive['name'],
+ 'parameters': self._map_primitive_parameters(
+ primitive['parameter'],
+ {'<rw_mgmt_ip>': rw_mgmt_ip}
+ ),
+ }
+
+ for primitive in sorted(primitives):
+ await self.ExecutePrimitive(
+ model_name,
+ application_name,
+ primitives[primitive]['name'],
+ callback,
+ callback_args,
+ **primitives[primitive]['parameters'],
+ )
+ except N2VCPrimitiveExecutionFailed as e:
+ self.debug.log(
+ "[N2VC] Exception executing primitive: {}".format(e)
+ )
+ raise
+