diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index 265b1c9a3f..950e3d78fc 100644 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -26,6 +26,7 @@ import textwrap from ansible.compat.six import iteritems +from ansible import constants as C from ansible.errors import AnsibleError, AnsibleOptionsError from ansible.plugins import module_loader from ansible.cli import CLI @@ -41,9 +42,6 @@ except ImportError: class DocCLI(CLI): """ Vault command line class """ - BLACKLIST_EXTS = ('.pyc', '.swp', '.bak', '~', '.rpm', '.md', '.txt') - IGNORE_FILES = [ "COPYING", "CONTRIBUTING", "LICENSE", "README", "VERSION", "GUIDELINES", "test-docs.sh"] - def __init__(self, args): super(DocCLI, self).__init__(args) @@ -96,7 +94,7 @@ class DocCLI(CLI): display.warning("module %s not found in %s\n" % (module, DocCLI.print_paths(module_loader))) continue - if any(filename.endswith(x) for x in self.BLACKLIST_EXTS): + if any(filename.endswith(x) for x in C.BLACKLIST_EXTS): continue try: @@ -143,11 +141,11 @@ class DocCLI(CLI): continue elif os.path.isdir(module): self.find_modules(module) - elif any(module.endswith(x) for x in self.BLACKLIST_EXTS): + elif any(module.endswith(x) for x in C.BLACKLIST_EXTS): continue elif module.startswith('__'): continue - elif module in self.IGNORE_FILES: + elif module in C.IGNORE_FILES: continue elif module.startswith('_'): fullpath = '/'.join([path,module]) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index 2ca0173438..d38dde6eb4 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -302,3 +302,6 @@ VAULT_VERSION_MIN = 1.0 VAULT_VERSION_MAX = 1.0 TREE_DIR = None LOCALHOST = frozenset(['127.0.0.1', 'localhost', '::1']) +# module search +BLACKLIST_EXTS = ('.pyc', '.swp', '.bak', '~', '.rpm', '.md', '.txt') +IGNORE_FILES = [ "COPYING", "CONTRIBUTING", "LICENSE", "README", "VERSION", "GUIDELINES", "test-docs.sh"]