示例#1
0
    def create_missing_ifc_delta_cfg(self):
        """Override the default implementation to leave indicator for absence of IFC configuration.
        Reminder: the purpose of this method is to prepare for configuration delete operation
        in diff_ifc_asa method.

        Note on implementing State.DESTROY operation for deviceAudit API on this translator:

          For deviceAudit operation, the framework uses the absence of self.delta_ifc_cfg_value
        to indicate this translator does not have IFC configuration. However, we have to create
        self.delta_ifc_cfg_value for this particular translator.

        Question: So how do we tell if IFC does not have configuration for this translator?
        Answer: by introducing an special entry, named 'PolicyMap_state', in the value dictionary for this translator,
                so that the get_action method can use this entry in the self.delta_ifc_cfg_value, i.e.
                self.delta_ifc_cfg_value['PolicyMap_state'] to determine if the operation is State.DESTROY.
        """
        if self.has_ifc_delta_cfg():
            return DMObject.create_missing_ifc_delta_cfg(self)

        self.mark_absent()

        for child in self.children.values():
            child.create_missing_ifc_delta_cfg()

        'Let PolicyMap share the configuration with this translator'
        policy_map = self.children.values()[0]
        policy_map.populate_model(self.delta_ifc_key, self.delta_ifc_cfg_value)