Created
April 30, 2017 03:24
-
-
Save gizmoguy/867deb42c9da2b92276d0ddc63f0a180 to your computer and use it in GitHub Desktop.
Python inspect module parsing faucet config options
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 | |
import inspect | |
import pprint | |
from dp import DP | |
from vlan import VLAN | |
from port import Port | |
pp = pprint.PrettyPrinter(indent=4) | |
dp_members = dict(inspect.getmembers(DP)) | |
vlan_members = dict(inspect.getmembers(VLAN)) | |
port_members = dict(inspect.getmembers(Port)) | |
print("DP config options:") | |
pp.pprint(dp_members['defaults']) | |
print("VLAN config options:") | |
pp.pprint(vlan_members['defaults']) | |
print("Port config options:") | |
pp.pprint(port_members['defaults']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment