How to use scrapli - 1 common examples

To help you get started, we’ve selected a few scrapli 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 eNMS-automation / eNMS / eNMS / models / automation.py View on Github external
def scrapli_connection(self, device):
        connection = self.get_or_close_connection("scrapli", device.name)
        if connection:
            self.log("info", "Using cached Scrapli connection", device)
            return connection
        self.log(
            "info", "OPENING Scrapli connection", device, logger="security",
        )
        username, password = self.get_credentials(device)
        connection = Scrapli(
            transport=self.transport,
            platform=device.scrapli_driver if self.use_device_driver else self.driver,
            host=device.ip_address,
            auth_username=username,
            auth_password=password,
            auth_private_key=False,
            auth_strict_key=False,
        )
        connection.open()
        app.connections_cache["scrapli"][self.parent_runtime][device.name] = connection
        return connection

scrapli

Fast, flexible, sync/async, Python 3.7+ screen scraping client specifically for network devices

MIT
Latest version published 3 months ago

Package Health Score

75 / 100
Full package analysis

Popular scrapli functions