junos¶
JunOS module.
-
class
homer.transports.junos.
ConnectedDevice
(fqdn: str, username: str = '')[source]¶ Bases:
object
Juniper transport to manage a JunOS connected device.
Initialize the instance and open the connection to the device.
- Parameters
-
commit
(config: str, message: str, callback: Callable, ignore_warning: Union[bool, str, List[str]] = False) → None[source]¶ Commit the loaded configuration.
- Parameters
config (str) -- the device new configuration.
message (str) -- the commit message to use.
callback (callable) -- a callable function that accepts two parameters: a string with the FQDN of the current device and a string with the diff between the current configuration and the new one. The callback must raise any exception if the execution should be interrupted and the config rollbacked or return
None
.
- Raises
HomerError -- when failing to commit the configuration.
-
commit_check
(config: str, ignore_warning: Union[bool, str, List[str]] = False) → Tuple[bool, str][source]¶ Perform commit check, reuturn the diff and rollback.