|
1 | 1 | __author__ = "desultory" |
2 | | -__version__ = "5.7.2" |
| 2 | +__version__ = "5.8.0" |
3 | 3 |
|
4 | 4 | from pathlib import Path |
5 | 5 | from typing import Union |
@@ -37,20 +37,7 @@ def _validate_mount_config(self, mount_name: str, mount_config) -> None: |
37 | 37 |
|
38 | 38 | for parameter, value in mount_config.copy().items(): |
39 | 39 | self.logger.debug("[%s] Validating parameter: %s" % (mount_name, parameter)) |
40 | | - if parameter == "source" and isinstance(value, dict): |
41 | | - self.logger.warning("source dict is deprecated, please define the source type directly.") |
42 | | - self.logger.info( |
43 | | - "Simply define the source type directly in the mount config, instead of using the 'source' dict." |
44 | | - ) |
45 | | - # Break if the source type is valid |
46 | | - for source_type in SOURCE_TYPES: |
47 | | - if source_type in value: |
48 | | - mount_config[source_type] = value[source_type] |
49 | | - break |
50 | | - else: |
51 | | - self.logger.error("Valid source types: %s" % SOURCE_TYPES) |
52 | | - raise ValueError("Invalid source type in mount: %s" % value) |
53 | | - elif parameter == "options" and not mount_config.get("no_validate_options"): |
| 40 | + if parameter == "options" and not mount_config.get("no_validate_options"): |
54 | 41 | for option in value: |
55 | 42 | if "subvol=" in option: |
56 | 43 | if mount_name == "root": |
@@ -601,7 +588,8 @@ def _autodetect_mount(self, mountpoint) -> None: |
601 | 588 | mount_name = "root" if mountpoint == "/" else mountpoint.removeprefix("/") |
602 | 589 | if mount_name in self["mounts"] and any(s_type in self["mounts"][mount_name] for s_type in SOURCE_TYPES): |
603 | 590 | return self.logger.warning( |
604 | | - "[%s] Mount config already set: %s" % (mountpoint, pretty_print(self["mounts"][mount_name])) |
| 591 | + "[%s] Skipping autodetection, mount config already set:\n%s" |
| 592 | + % (colorize(mountpoint, "yellow"), pretty_print(self["mounts"][mount_name])) |
605 | 593 | ) |
606 | 594 |
|
607 | 595 | mount_config = {mount_name: {"type": "auto", "options": ["ro"]}} # Default to auto and ro |
|
0 commit comments