Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ docs/_build/
*COMMIT_MSG

.qbcache/

.idea/

4 changes: 2 additions & 2 deletions agent_packager/dictconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ def valid_ident(s):
raise ValueError('Not a valid Python identifier: %r' % s)
return True

#

# This function is defined in logging only in recent versions of Python
#
try:
from logging import _checkLevel
except ImportError:
Expand Down Expand Up @@ -538,6 +537,7 @@ def configure_root(self, config, incremental=False):
root = logging.getLogger()
self.common_logger_config(root, config, incremental)


dictConfigClass = DictConfigurator


Expand Down
1 change: 1 addition & 0 deletions agent_packager/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def _import_config(config_file=DEFAULT_CONFIG_FILE):

:param string config_file: path to config file
"""
config_file = os.path.expanduser(config_file)
lgr.debug('Importing config: {0}...'.format(config_file))
try:
with open(config_file, 'r') as c:
Expand Down
14 changes: 7 additions & 7 deletions agent_packager/tests/test_agent_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def venv(func):
def execution_handler(*args, **kwargs):
try:
shutil.rmtree(TEST_VENV)
except:
except Exception:
pass
utils.make_virtualenv(TEST_VENV)
func(*args, **kwargs)
Expand All @@ -60,16 +60,16 @@ class TestUtils(testtools.TestCase):
def test_set_global_verbosity_level(self):
lgr = init(base_level=logging.INFO)

with LogCapture() as l:
with LogCapture() as log_cap:
ap.set_global_verbosity_level(is_verbose_output=False)
lgr.debug('TEST_LOGGER_OUTPUT')
l.check()
log_cap.check()
lgr.info('TEST_LOGGER_OUTPUT')
l.check(('user', 'INFO', 'TEST_LOGGER_OUTPUT'))
log_cap.check(('user', 'INFO', 'TEST_LOGGER_OUTPUT'))

ap.set_global_verbosity_level(is_verbose_output=True)
lgr.debug('TEST_LOGGER_OUTPUT')
l.check(
log_cap.check(
('user', 'INFO', 'TEST_LOGGER_OUTPUT'),
('user', 'DEBUG', 'TEST_LOGGER_OUTPUT'))

Expand Down Expand Up @@ -263,9 +263,9 @@ def test_dryrun(self):
'--no-validation': False,
'--verbose': True
}
with LogCapture(level=logging.INFO) as l:
with LogCapture(level=logging.INFO) as log_cap:
e = self.assertRaises(SystemExit, cli._run, cli_options)
l.check(('user', 'INFO', 'Dryrun complete'))
log_cap.check(('user', 'INFO', 'Dryrun complete'))
self.assertEqual(codes.notifications['dryrun_complete'], e.message)

@venv
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def read(*parts):

setup(
name='cloudify-agent-packager',
version='4.0.1',
version='4.3',
url='https://github.com/cloudify-cosmo/cloudify-agent-packager',
author='Gigaspaces',
author_email='[email protected]',
Expand Down