Skip to content

Commit 67bde40

Browse files
author
illumin-us-r3v0lution
committed
Update reclass cli entry points, use the logger from reclass.logger
While the reclass.logger module initializes a logger with a basic config, it also enables/disables debug logging with the --debug option flag. Thus, we want to use the logger initialized by reclass.logger for the CLI entry points.
1 parent aa44410 commit 67bde40

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

reclass/adapters/ansible.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from reclass.config import find_and_read_configfile, get_options
2020
from reclass.version import *
2121
from reclass.constants import MODE_NODEINFO
22+
from reclass.logs import logger
2223

2324
def cli():
2425
try:
@@ -53,6 +54,7 @@ def add_ansible_options_group(parser, defaults):
5354
nodeinfo_help='output host_vars for the given host',
5455
add_options_cb=add_ansible_options_group,
5556
defaults=defaults)
57+
logger.debug('parsed options: %s' % options)
5658

5759
storage = get_storage(options.storage_type, options.nodes_uri,
5860
options.classes_uri)

reclass/adapters/salt.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
path_mangler
1717
from reclass.constants import MODE_NODEINFO
1818
from reclass.defaults import *
19+
from reclass.logger import logger
1920
from reclass.version import *
2021

22+
2123
def ext_pillar(minion_id, pillar,
2224
storage_type=OPT_STORAGE_TYPE,
2325
inventory_base_uri=OPT_INVENTORY_BASE_URI,
@@ -94,6 +96,7 @@ def cli():
9496
nodeinfo_dest='nodename',
9597
nodeinfo_help='output pillar data for a specific node',
9698
defaults=defaults)
99+
logger.debug('parsed options: %s' % options)
97100
class_mappings = defaults.get('class_mappings')
98101

99102
if options.mode == MODE_NODEINFO:

reclass/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
from reclass.errors import ReclassException
1717
from reclass.defaults import *
1818
from reclass.constants import MODE_NODEINFO
19+
from reclass.logs import logger
1920
from reclass.version import *
2021

21-
logger = logging.getLogger(RECLASS_NAME)
22-
2322

2423
def main():
2524
try:

0 commit comments

Comments
 (0)