mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 14:21:26 -07:00
Only print warning when ansible.cfg is actually skipped (#43583)
Only print warning when ansible.cfg is actually skipped * Also add unittests for the find_ini_config_file function * Add documentation on world writable current working directory config files can no longer be loaded from a world writable current working directory but the end user is allowed to specify that explicitly. Give appropriate warnings and information on how. Fixes #42388
This commit is contained in:
parent
48280463f2
commit
30662bedad
6 changed files with 314 additions and 26 deletions
|
@ -3,6 +3,7 @@ from __future__ import (absolute_import, division, print_function)
|
|||
__metaclass__ = type
|
||||
|
||||
import os
|
||||
import os.path
|
||||
|
||||
from ansible.compat.tests import unittest
|
||||
|
||||
|
@ -50,12 +51,6 @@ class TestConfigData(unittest.TestCase):
|
|||
self.assertIsInstance(ensure_type('0.10', 'float'), float)
|
||||
self.assertIsInstance(ensure_type(0.2, 'float'), float)
|
||||
|
||||
def test_find_ini_file(self):
|
||||
cur_config = os.environ['ANSIBLE_CONFIG']
|
||||
os.environ['ANSIBLE_CONFIG'] = cfg_file
|
||||
self.assertEquals(cfg_file, find_ini_config_file())
|
||||
os.environ['ANSIBLE_CONFIG'] = cur_config
|
||||
|
||||
def test_resolve_path(self):
|
||||
self.assertEquals(os.path.join(curdir, 'test.yml'), resolve_path('./test.yml', cfg_file))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue