From b162960603131ab1b157b09c1f6661b19c9b107a Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Wed, 2 Dec 2020 13:54:23 -0800 Subject: [PATCH] limit what gets imported when importing * --- bitelab/config.py | 2 ++ bitelab/mocks.py | 2 ++ bitelab/snmp.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/bitelab/config.py b/bitelab/config.py index 948f493..1b04602 100644 --- a/bitelab/config.py +++ b/bitelab/config.py @@ -31,6 +31,8 @@ from pydantic import BaseSettings, Field import asyncio import aiokq +__all__ = [ 'Settings' ] + # How to deal w/ private vars: # https://web.archive.org/web/20201113005838/https://github.com/samuelcolvin/pydantic/issues/655 class Settings(BaseSettings): diff --git a/bitelab/mocks.py b/bitelab/mocks.py index 952ac8a..f54d3b6 100644 --- a/bitelab/mocks.py +++ b/bitelab/mocks.py @@ -28,6 +28,8 @@ from unittest.mock import AsyncMock, Mock +__all__ = [ 'wrap_subprocess_exec' ] + def wrap_subprocess_exec(mockobj, stdout=b'', stderr=b'', retcode=0): assert isinstance(stdout, bytes) assert isinstance(stderr, bytes) diff --git a/bitelab/snmp.py b/bitelab/snmp.py index 174f2c2..d9ee553 100644 --- a/bitelab/snmp.py +++ b/bitelab/snmp.py @@ -35,6 +35,8 @@ import asyncio import subprocess import unittest +__all__ = [ 'snmpget', 'snmpset', 'SNMPPower' ] + async def snmpget(host, oid, type): p = await asyncio.create_subprocess_exec('snmpget', '-Oqv', host, oid, stdout=subprocess.PIPE)