diff --git a/netmiko/cisco/cisco_xr.py b/netmiko/cisco/cisco_xr.py index fae8d2556..3e6a19848 100644 --- a/netmiko/cisco/cisco_xr.py +++ b/netmiko/cisco/cisco_xr.py @@ -52,12 +52,25 @@ def send_config_set( config_commands=config_commands, exit_config_mode=exit_config_mode, **kwargs ) + def _commit_handler( + self, command_string: str, expect_string: str, read_timeout: float + ) -> str: + """Wrapper for commit call to simplify code and arguments.""" + return self._send_command_str( + command_string, + expect_string=expect_string, + strip_prompt=False, + strip_command=False, + read_timeout=read_timeout, + ) + def commit( self, confirm: bool = False, confirm_delay: Optional[int] = None, comment: str = "", label: str = "", + replace: bool = False, read_timeout: float = 120.0, delay_factor: Optional[float] = None, ) -> str: @@ -73,6 +86,11 @@ def commit( comment: command_string = commit comment + # With 'replace'--replace will be first and then any subsequent options following the + # above rules. + replace: + command_string = commit replace [other options] + delay_factor: Deprecated in Netmiko 4.x. Will be eliminated in Netmiko 5. supported combinations @@ -81,6 +99,8 @@ def commit( label and comment: command_string = commit label