|
1 | | -from typing import Optional, Dict |
| 1 | +from typing import Optional, List, Dict |
2 | 2 | import base64 |
3 | 3 | import io |
4 | 4 | import os |
@@ -64,9 +64,7 @@ def _load_mirrors(self, cmdline_cache: Optional[pathlib.Path]) -> Dict[str, Dict |
64 | 64 | buildcache = mirrors.get("buildcache") |
65 | 65 | if buildcache and buildcache.get("enabled", True): |
66 | 66 | if not buildcache.get("private_key"): |
67 | | - raise MirrorError( |
68 | | - "Mirror build cache config is missing a required 'private_key' path." |
69 | | - ) |
| 67 | + raise MirrorError("Mirror build cache config is missing a required 'private_key' path.") |
70 | 68 | self.build_cache_mirror = "buildcache" |
71 | 69 | enabled_mirrors["buildcache"] = buildcache |
72 | 70 | else: |
@@ -120,7 +118,7 @@ def _load_cmdline_cache(self, cache_config_path: pathlib.Path) -> Dict: |
120 | 118 | "enabled": True, |
121 | 119 | "mount_specific": True, |
122 | 120 | "private_key": raw["key"], |
123 | | - "cmdline": True |
| 121 | + "cmdline": True, |
124 | 122 | } |
125 | 123 |
|
126 | 124 | self._logger.warning( |
@@ -180,7 +178,7 @@ def _create_spack_mirrors_yaml(self, dest: pathlib.Path): |
180 | 178 | url = mirror["url"] |
181 | 179 |
|
182 | 180 | # Make the mirror path specific to the mount point |
183 | | - if(name=="buildcache"): |
| 181 | + if name == "buildcache": |
184 | 182 | if mirror["mount_specific"] and self._mount_point is not None: |
185 | 183 | url = url.rstrip("/") + "/" + self._mount_point.as_posix().lstrip("/") |
186 | 184 |
|
@@ -223,8 +221,8 @@ def _create_bootstrap_configs(self, config_root: pathlib.Path): |
223 | 221 | "type": "install", |
224 | 222 | "info": { |
225 | 223 | "url": mirror["url"], |
226 | | - } |
227 | | - } |
| 224 | + }, |
| 225 | + } |
228 | 226 | with (bs_mirror_path / "metadata.yaml").open("w") as file: |
229 | 227 | yaml.dump(bs_mirror_yaml, file, default_flow_style=False) |
230 | 228 |
|
@@ -271,8 +269,7 @@ def _load_key(self, key: str, dest: pathlib.Path, name: str): |
271 | 269 | writer.write(binary_key) |
272 | 270 |
|
273 | 271 | self._keys.append(dest) |
274 | | - |
275 | | - |
| 272 | + |
276 | 273 | def _key_setup(self, key_store: pathlib.Path): |
277 | 274 | """Iterate through mirror keys and load + relocate each one to key_store""" |
278 | 275 |
|
|
0 commit comments