Return parsed metadata for a particular pack directory. :rtype: ``dict``
(pack_dir)
| 98 | |
| 99 | |
| 100 | def 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 | |
| 121 | def get_pack_warnings(pack_metadata): |
no test coverage detected