MCPcopy Create free account
hub / github.com/StackStorm/st2 / check_pack_directory_exists

Function check_pack_directory_exists

st2common/st2common/content/utils.py:94–110  ·  view source on GitHub ↗

Check if a provided pack exists in one of the pack paths. :param pack: Pack name. :type pack: ``str`` :rtype: ``bool``

(pack)

Source from the content-addressed store, hash-verified

92
93
94def check_pack_directory_exists(pack):
95 """
96 Check if a provided pack exists in one of the pack paths.
97
98 :param pack: Pack name.
99 :type pack: ``str``
100
101 :rtype: ``bool``
102 """
103 packs_base_paths = get_packs_base_paths()
104
105 for base_dir in packs_base_paths:
106 pack_path = os.path.join(base_dir, pack)
107 if os.path.exists(pack_path):
108 return True
109
110 return False
111
112
113def check_pack_content_directory_exists(pack, content_type):

Callers

nothing calls this directly

Calls 2

get_packs_base_pathsFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected