This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from my_custom_network_importer.models import CustomSite | |
from network_importer.adapters.network_importer.adapter import NetworkImporterAdapter | |
from network_importer.adapters.nautobot_api.adapter import NautobotAPIAdapter | |
class CustomNetworkImporterAdapter(NetworkImporterAdapter): | |
site = CustomSite | |
def load_batfish_device(self, device): | |
super().load_batfish_device(device=device) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nautobot.dcim.models import Device | |
from nautobot.dcim.models import Interface | |
from nautobot.dcim.choices import InterfaceTypeChoices | |
from nautobot.ipam.models import VLAN | |
from nautobot.extras.jobs import Job | |
class TestJob(Job): | |
class Meta: | |
description = "Some job jo!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
from nornir.core.deserializer.inventory import Inventory | |
from nornir.plugins.inventory.netbox import NBInventory, NetboxInventory2 | |
# We need import below to load fixtures | |
import pytest # noqa | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.7 | |
""" | |
Usage: pipenvlink path/to/script.py | |
Result: bash file named 'script' that runs script.py in its venv from anywhere | |
""" | |
import os | |
import sys | |
from pathlib import Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ranger.api | |
import ranger.core.linemode | |
from ranger.ext.human_readable import human_readable | |
from datetime import datetime | |
@ranger.api.register_linemode | |
class SizeCtimeLineMode(ranger.core.linemode.LinemodeBase): | |
name = "sizectime" | |
def filetitle(self, file, metadata): |