def node_add(self, node_sum, node_other):
        '''node_add

        High-level api: Combine two configs or apply an instance of ConfigDelta
        to a config. This method is recursive. node_sum will be modified during
        the process, and it becomes the result at the end.

        Parameters
        ----------

        node_sum : `Element`
            A config node in a config tree.

        node_other : `Element`
            A config node in another config tree.

        Returns
        -------

        None
            There is no return of this method.
        '''

        supported_node_type = [
            'leaf',
            'leaf-list',
            'container',
            'list',
            ]
        in_s_not_in_o, in_o_not_in_s, in_s_and_in_o = \
            self._group_kids(node_sum, node_other)
        for child_self in in_s_not_in_o:
            pass
        for child_other in in_o_not_in_s:
            # delete
            if child_other.get(operation_tag) == 'delete':
                raise ConfigDeltaError('data-missing: try to delete node {} ' \
                                       'but it does not exist in config' \
                                       .format(self.device \
                                                   .get_xpath(child_other)))
            # remove
            elif child_other.get(operation_tag) == 'remove':
                pass
            # merge, replace, create or none
            else:
                s_node = self.device.get_schema_node(child_other)
                if s_node.get('type') in supported_node_type:
                    getattr(self,
                            '_node_add_without_peer_{}' \
                            .format(s_node.get('type').replace('-', ''))) \
                            (node_sum, child_other)
        for child_self, child_other in in_s_and_in_o:
            s_node = self.device.get_schema_node(child_self)
            if s_node.get('type') in supported_node_type:
                getattr(self,
                        '_node_add_with_peer_{}' \
                        .format(s_node.get('type').replace('-', ''))) \
                        (child_self, child_other)
def node_add ( self , node_sum , node_other ) : supported_node_type = [ 'leaf' , 'leaf-list' , 'container' , 'list' , ] in_s_not_in_o , in_o_not_in_s , in_s_and_in_o = self . _group_kids ( node_sum , node_other ) for child_self in in_s_not_in_o : pass for child_other in in_o_not_in_s : if child_other . get ( operation_tag ) == 'delete' : raise ConfigDeltaError ( 'data-missing: try to delete node {} ' 'but it does not exist in config' . format ( self . device . get_xpath ( child_other ) ) ) elif child_other . get ( operation_tag ) == 'remove' : pass else : s_node = self . device . get_schema_node ( child_other ) if s_node . get ( 'type' ) in supported_node_type : getattr ( self , '_node_add_without_peer_{}' . format ( s_node . get ( 'type' ) . replace ( '-' , '' ) ) ) ( node_sum , child_other ) for child_self , child_other in in_s_and_in_o : s_node = self . device . get_schema_node ( child_self ) if s_node . get ( 'type' ) in supported_node_type : getattr ( self , '_node_add_with_peer_{}' . format ( s_node . get ( 'type' ) . replace ( '-' , '' ) ) ) ( child_self , child_other )
node_add

        High-level api: Combine two configs or apply an instance of ConfigDelta
        to a config. This method is recursive. node_sum will be modified during
        the process, and it becomes the result at the end.

        Parameters
        ----------

        node_sum : `Element`
            A config node in a config tree.

        node_other : `Element`
            A config node in another config tree.

        Returns
        -------

        None
            There is no return of this method.