Commit c9f05d80 authored by PabloArmingolRobles's avatar PabloArmingolRobles
Browse files

Commit per rulle in SetConfig

parent 09881403
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ class NetconfSessionHandler:
    def use_candidate(self): return self.__candidate_supported and not self.__force_running

    @property
    def commit_per_delete_rule(self): return self.__commit_per_delete 
    def commit_per_rule(self): return self.__commit_per_delete 

    @RETRY_DECORATOR
    def get(self, filter=None, with_defaults=None): # pylint: disable=redefined-builtin
@@ -284,6 +284,9 @@ class OpenConfigDriver(_Driver):
        with self.__lock:
            if self.__netconf_handler.use_candidate:
                with self.__netconf_handler.locked(target='candidate'):
                    if self.__netconf_handler.commit_per_rule:
                           results = edit_config(self.__netconf_handler, resources, target='candidate', commit_per_rule= True)
                    else:
                        results = edit_config(self.__netconf_handler, resources, target='candidate')
                        try:
                            self.__netconf_handler.commit()
@@ -300,7 +303,7 @@ class OpenConfigDriver(_Driver):
        with self.__lock:
            if self.__netconf_handler.use_candidate:
                with self.__netconf_handler.locked(target='candidate'):
                    if self.__netconf_handler.commit_per_delete_rule:
                    if self.__netconf_handler.commit_per_rule:
                           results = edit_config(self.__netconf_handler, resources, target='candidate', delete=True, commit_per_rule= True)
                    else:
                        results = edit_config(self.__netconf_handler, resources, target='candidate', delete=True)