Skip to content

Commit

Permalink
Update reclass cli entry points, use the logger from reclass.logger
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
illumin-us-r3v0lution committed Oct 3, 2014
1 parent aa44410 commit 67bde40
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions reclass/adapters/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from reclass.config import find_and_read_configfile, get_options
from reclass.version import *
from reclass.constants import MODE_NODEINFO
from reclass.logs import logger

def cli():
try:
Expand Down Expand Up @@ -53,6 +54,7 @@ def add_ansible_options_group(parser, defaults):
nodeinfo_help='output host_vars for the given host',
add_options_cb=add_ansible_options_group,
defaults=defaults)
logger.debug('parsed options: %s' % options)

storage = get_storage(options.storage_type, options.nodes_uri,
options.classes_uri)
Expand Down
3 changes: 3 additions & 0 deletions reclass/adapters/salt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
path_mangler
from reclass.constants import MODE_NODEINFO
from reclass.defaults import *
from reclass.logger import logger
from reclass.version import *


def ext_pillar(minion_id, pillar,
storage_type=OPT_STORAGE_TYPE,
inventory_base_uri=OPT_INVENTORY_BASE_URI,
Expand Down Expand Up @@ -94,6 +96,7 @@ def cli():
nodeinfo_dest='nodename',
nodeinfo_help='output pillar data for a specific node',
defaults=defaults)
logger.debug('parsed options: %s' % options)
class_mappings = defaults.get('class_mappings')

if options.mode == MODE_NODEINFO:
Expand Down
3 changes: 1 addition & 2 deletions reclass/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
from reclass.errors import ReclassException
from reclass.defaults import *
from reclass.constants import MODE_NODEINFO
from reclass.logs import logger
from reclass.version import *

logger = logging.getLogger(RECLASS_NAME)


def main():
try:
Expand Down

0 comments on commit 67bde40

Please sign in to comment.