To commit the changes loaded in the candidate configuration. dev_timeout : 30 The NETCONF RPC timeout (in seconds) comment Provide a comment for the commit confirm Provide time in minutes for commit confirmation. If this option is specified, the commit w
(**kwargs)
| 505 | |
| 506 | @_timeout_decorator |
| 507 | def commit(**kwargs): |
| 508 | """ |
| 509 | To commit the changes loaded in the candidate configuration. |
| 510 | |
| 511 | dev_timeout : 30 |
| 512 | The NETCONF RPC timeout (in seconds) |
| 513 | |
| 514 | comment |
| 515 | Provide a comment for the commit |
| 516 | |
| 517 | confirm |
| 518 | Provide time in minutes for commit confirmation. If this option is |
| 519 | specified, the commit will be rolled back in the specified amount of time |
| 520 | unless the commit is confirmed. |
| 521 | |
| 522 | sync : False |
| 523 | When ``True``, on dual control plane systems, requests that the candidate |
| 524 | configuration on one control plane be copied to the other control plane, |
| 525 | checked for correct syntax, and committed on both Routing Engines. |
| 526 | |
| 527 | force_sync : False |
| 528 | When ``True``, on dual control plane systems, force the candidate |
| 529 | configuration on one control plane to be copied to the other control |
| 530 | plane. |
| 531 | |
| 532 | full |
| 533 | When ``True``, requires all the daemons to check and evaluate the new |
| 534 | configuration. |
| 535 | |
| 536 | detail |
| 537 | When ``True``, return commit detail |
| 538 | |
| 539 | CLI Examples: |
| 540 | |
| 541 | .. code-block:: bash |
| 542 | |
| 543 | salt 'device_name' junos.commit comment='Commiting via saltstack' detail=True |
| 544 | salt 'device_name' junos.commit dev_timeout=60 confirm=10 |
| 545 | salt 'device_name' junos.commit sync=True dev_timeout=90 |
| 546 | """ |
| 547 | |
| 548 | conn = __proxy__["junos.conn"]() |
| 549 | ret = {} |
| 550 | op = dict() |
| 551 | if "__pub_arg" in kwargs: |
| 552 | if kwargs["__pub_arg"]: |
| 553 | if isinstance(kwargs["__pub_arg"][-1], dict): |
| 554 | op.update(kwargs["__pub_arg"][-1]) |
| 555 | else: |
| 556 | op.update(kwargs) |
| 557 | |
| 558 | op["detail"] = op.get("detail", False) |
| 559 | |
| 560 | try: |
| 561 | commit_ok = conn.cu.commit_check() |
| 562 | except Exception as exception: # pylint: disable=broad-except |
| 563 | ret["message"] = f'Could not perform commit check due to "{exception}"' |
| 564 | ret["out"] = False |