(
self,
opts,
remote,
per_remote_defaults,
per_remote_only,
override_params,
cache_root,
role="gitfs",
)
| 256 | _master_lock = multiprocessing.Lock() |
| 257 | |
| 258 | def __init__( |
| 259 | self, |
| 260 | opts, |
| 261 | remote, |
| 262 | per_remote_defaults, |
| 263 | per_remote_only, |
| 264 | override_params, |
| 265 | cache_root, |
| 266 | role="gitfs", |
| 267 | ): |
| 268 | self.opts = opts |
| 269 | self.role = role |
| 270 | |
| 271 | def _val_cb(x, y): |
| 272 | return str(y) |
| 273 | |
| 274 | # get machine_identifier |
| 275 | self.mach_id = _get_machine_identifier().get( |
| 276 | "machine_id", "no_machine_id_available" |
| 277 | ) |
| 278 | |
| 279 | self.global_saltenv = salt.utils.data.repack_dictlist( |
| 280 | self.opts.get(f"{self.role}_saltenv", []), |
| 281 | strict=True, |
| 282 | recurse=True, |
| 283 | key_cb=str, |
| 284 | val_cb=_val_cb, |
| 285 | ) |
| 286 | self.conf = copy.deepcopy(per_remote_defaults) |
| 287 | # Remove the 'salt://' from the beginning of any globally-defined |
| 288 | # per-saltenv mountpoints |
| 289 | for saltenv, saltenv_conf in self.global_saltenv.items(): |
| 290 | if "mountpoint" in saltenv_conf: |
| 291 | self.global_saltenv[saltenv]["mountpoint"] = salt.utils.url.strip_proto( |
| 292 | self.global_saltenv[saltenv]["mountpoint"] |
| 293 | ) |
| 294 | |
| 295 | per_remote_collisions = [x for x in override_params if x in per_remote_only] |
| 296 | if per_remote_collisions: |
| 297 | log.critical( |
| 298 | "The following parameter names are restricted to per-remote " |
| 299 | "use only: %s. This is a bug, please report it.", |
| 300 | ", ".join(per_remote_collisions), |
| 301 | ) |
| 302 | |
| 303 | try: |
| 304 | valid_per_remote_params = override_params + per_remote_only |
| 305 | except TypeError: |
| 306 | valid_per_remote_params = list(override_params) + list(per_remote_only) |
| 307 | |
| 308 | if isinstance(remote, dict): |
| 309 | self.id = next(iter(remote)) |
| 310 | self.get_url() |
| 311 | |
| 312 | per_remote_conf = salt.utils.data.repack_dictlist( |
| 313 | remote[self.id], |
| 314 | strict=True, |
| 315 | recurse=True, |
nothing calls this directly
no test coverage detected