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

Function get_pack_metadata

st2common/st2common/util/pack.py:100–118  ·  view source on GitHub ↗

Return parsed metadata for a particular pack directory. :rtype: ``dict``

(pack_dir)

Source from the content-addressed store, hash-verified

98
99
100def get_pack_metadata(pack_dir):
101 """
102 Return parsed metadata for a particular pack directory.
103
104 :rtype: ``dict``
105 """
106 manifest_path = os.path.join(pack_dir, MANIFEST_FILE_NAME)
107
108 if not os.path.isfile(manifest_path):
109 raise ValueError(
110 'Pack "%s" is missing %s file' % (pack_dir, MANIFEST_FILE_NAME)
111 )
112
113 meta_loader = MetaLoader()
114 content = meta_loader.load(manifest_path)
115 if not content:
116 raise ValueError('Pack "%s" metadata file is empty' % (pack_dir))
117
118 return content
119
120
121def get_pack_warnings(pack_metadata):

Callers 6

get_warningsFunction · 0.90
get_pack_versionFunction · 0.90
get_dependency_listFunction · 0.90
_register_pack_dbMethod · 0.90
download_packFunction · 0.90
get_pack_refFunction · 0.90

Calls 2

loadMethod · 0.95
MetaLoaderClass · 0.90

Tested by

no test coverage detected