ktbyers / netmiko_tools

Command line tools built on Netmiko to simplify information gathering
Apache License 2.0
93 stars 32 forks source link

make debug mode a cli argument? #14

Open boxs3lli opened 8 years ago

boxs3lli commented 8 years ago

vi /usr/lib/python2.7/site-packages/netmiko/base_connection.py :%s/debug = False/debug = True/g

[x@x netmiko]# grep debug /usr/lib/python2.7/site-packages/netmiko/*.py
base_connection.py:        debug = True
base_connection.py:        if debug:
base_connection.py:        if debug:
base_connection.py:        debug = True
base_connection.py:        if debug:
base_connection.py:        if debug:
base_connection.py:                if debug:
base_connection.py:        if debug:
base_connection.py:        debug = True
base_connection.py:        if debug:
base_connection.py:        if debug:
base_connection.py:        if debug:
base_connection.py:        debug = True
base_connection.py:        if debug:
base_connection.py:                    if debug:
base_connection.py:        debug = True
base_connection.py:                if debug:
base_connection.py:        if debug:
base_connection.py:                if debug:
base_connection.py:        debug = True
base_connection.py:        if debug:
base_connection.py:        debug = True
base_connection.py:        if debug:
base_connection.py:        if debug:
ktbyers commented 8 years ago

Probably the way to do this is to add a parameter to the class like 'global_debug'. If you pass in this parameter then debugging would be enabled. You could then toggle this by changing your device inventory (i.e. by setting debug to true).

Come to think of it I already have the 'verbose' flag which really does nothing. I could re-wire that for that purpose.

if debug or self.verbose:
    do_something