How to use the nornir.core.connections.Connections function in nornir

To help you get started, we’ve selected a few nornir examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nornir-automation / nornir / tests / core / test_connections.py View on Github external
def setup_method(self, method):
        Connections.deregister_all()
        Connections.register("dummy", DummyConnectionPlugin)
        Connections.register("another_dummy", AnotherDummyConnectionPlugin)
github nornir-automation / nornir / tests / core / test_connections.py View on Github external
def test_register_already_registered_same(self):
        Connections.register("dummy", DummyConnectionPlugin)
        assert Connections.available["dummy"] == DummyConnectionPlugin
github nornir-automation / nornir / tests / core / test_connections.py View on Github external
def test_deregister_nonexistent(self):
        with pytest.raises(ConnectionPluginNotRegistered):
            Connections.deregister("nonexistent_dummy")
github nornir-automation / nornir / tests / core / test_connections.py View on Github external
def test_deregister_all(self):
        Connections.deregister_all()
        assert Connections.available == {}
github nornir-automation / nornir / tests / core / test_connections.py View on Github external
def test_get_plugin(self):
        assert Connections.get_plugin("dummy") == DummyConnectionPlugin
        assert Connections.get_plugin("another_dummy") == AnotherDummyConnectionPlugin
        assert len(Connections.available) == 2
github nornir-automation / nornir / nornir / init_nornir.py View on Github external
def register_default_connection_plugins() -> None:
    Connections.register("napalm", Napalm)
    Connections.register("netconf", Netconf)
    Connections.register("netmiko", Netmiko)
    Connections.register("paramiko", Paramiko)
github nornir-automation / nornir / nornir / plugins / connections / __init__.py View on Github external
def register_default_connection_plugins() -> None:
    Connections.register("napalm", Napalm)
    Connections.register("netmiko", Netmiko)
    Connections.register("paramiko", Paramiko)
github nornir-automation / nornir / nornir / init_nornir.py View on Github external
def register_default_connection_plugins() -> None:
    Connections.register("napalm", Napalm)
    Connections.register("netconf", Netconf)
    Connections.register("netmiko", Netmiko)
    Connections.register("paramiko", Paramiko)
github nornir-automation / nornir / nornir / plugins / connections / __init__.py View on Github external
def register_default_connection_plugins() -> None:
    Connections.register("napalm", Napalm)
    Connections.register("netmiko", Netmiko)
    Connections.register("paramiko", Paramiko)
github nornir-automation / nornir / nornir / core / inventory.py View on Github external
def __init__(
        self, name: str, defaults: Optional[Defaults] = None, **kwargs
    ) -> None:
        self.name = name
        self.defaults = defaults or Defaults()
        self.connections: Connections = Connections()
        super().__init__(**kwargs)