Add -l/--log-level option. Honor __cdist_loglevel env var. (#572)
Add -l/--log-level option, __cdist_loglevel -> __cdist_log_level; honor __cdist_log_level env var
This commit is contained in:
parent
f08ac264a0
commit
3454da076f
23 changed files with 152 additions and 69 deletions
|
|
@ -23,6 +23,7 @@
|
|||
import getpass
|
||||
import os
|
||||
import shutil
|
||||
import logging
|
||||
|
||||
import cdist
|
||||
from cdist import core
|
||||
|
|
@ -100,6 +101,7 @@ class CodeTestCase(test.CdistTestCase):
|
|||
self.assertEqual(output_dict['__files'], self.local.files_path)
|
||||
self.assertEqual(output_dict['__target_host_tags'],
|
||||
self.local.target_host_tags)
|
||||
self.assertEqual(output_dict['__cdist_log_level'], 'WARNING')
|
||||
|
||||
def test_run_gencode_remote_environment(self):
|
||||
output_string = self.code.run_gencode_remote(self.cdist_object)
|
||||
|
|
@ -125,6 +127,7 @@ class CodeTestCase(test.CdistTestCase):
|
|||
self.assertEqual(output_dict['__files'], self.local.files_path)
|
||||
self.assertEqual(output_dict['__target_host_tags'],
|
||||
self.local.target_host_tags)
|
||||
self.assertEqual(output_dict['__cdist_log_level'], 'WARNING')
|
||||
|
||||
def test_transfer_code_remote(self):
|
||||
self.cdist_object.code_remote = self.code.run_gencode_remote(
|
||||
|
|
|
|||
|
|
@ -10,3 +10,4 @@ echo "echo __object_id: $__object_id"
|
|||
echo "echo __object_name: $__object_name"
|
||||
echo "echo __files: $__files"
|
||||
echo "echo __target_host_tags: $__target_host_tags"
|
||||
echo "echo __cdist_log_level: $__cdist_log_level"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue