Check if a provided pack exists in one of the pack paths. :param pack: Pack name. :type pack: ``str`` :param content_type: Content type (actions, sensors, rules). :type content_type: ``str`` :rtype: ``bool``
(pack, content_type)
| 111 | |
| 112 | |
| 113 | def check_pack_content_directory_exists(pack, content_type): |
| 114 | """ |
| 115 | Check if a provided pack exists in one of the pack paths. |
| 116 | |
| 117 | :param pack: Pack name. |
| 118 | :type pack: ``str`` |
| 119 | |
| 120 | :param content_type: Content type (actions, sensors, rules). |
| 121 | :type content_type: ``str`` |
| 122 | |
| 123 | :rtype: ``bool`` |
| 124 | """ |
| 125 | packs_base_paths = get_packs_base_paths() |
| 126 | |
| 127 | for base_dir in packs_base_paths: |
| 128 | pack_content_pack = os.path.join(base_dir, pack, content_type) |
| 129 | if os.path.exists(pack_content_pack): |
| 130 | return True |
| 131 | |
| 132 | return False |
| 133 | |
| 134 | |
| 135 | def get_pack_base_path(pack_name, include_trailing_slash=False, use_pack_cache=False): |
no test coverage detected