|
1 | | -__version__ = '0.6.0' |
| 1 | +__version__ = '0.6.2' |
2 | 2 | __author__ = 'desultory' |
3 | 3 |
|
4 | 4 | from ugrd.fs.mounts import _get_mount_source |
5 | 5 |
|
6 | 6 |
|
7 | 7 | def _process_root_subvol(self, root_subvol: str) -> None: |
8 | | - """ |
9 | | - processes the root subvolume |
10 | | - Removes options in the root mount if they are set |
11 | | - """ |
| 8 | + """ processes the root subvolume """ |
12 | 9 | self.update({'root_subvol': root_subvol}) |
13 | 10 | self.logger.debug("Set root_subvol to: %s", root_subvol) |
14 | 11 |
|
15 | 12 |
|
16 | 13 | def _process_subvol_selector(self, subvol_selector: bool) -> None: |
17 | | - """ |
18 | | - processes the subvol selector |
19 | | - """ |
| 14 | + """ Processes the subvol selector parameter, adds the base_mount_paths to paths if enabled. """ |
20 | 15 | if subvol_selector: |
21 | 16 | self.update({'subvol_selector': subvol_selector}) |
22 | 17 | self.logger.debug("Set subvol_selector to: %s", subvol_selector) |
23 | 18 | self['paths'] = self['base_mount_path'] |
24 | 19 |
|
25 | 20 |
|
26 | 21 | def btrfs_scan(self) -> str: |
27 | | - """ |
28 | | - sccans for new mounts |
29 | | - """ |
| 22 | + """ scan for new btrfs devices. """ |
30 | 23 | return "btrfs device scan" |
31 | 24 |
|
32 | 25 |
|
33 | 26 | def select_subvol(self) -> str: |
34 | | - """ |
35 | | - Returns a bash script to list subvolumes on the root volume |
36 | | - """ |
37 | | - if not self['subvol_selector']: |
| 27 | + """ Returns a bash script to list subvolumes on the root volume. """ |
| 28 | + if not self.get('subvol_selector'): |
38 | 29 | self.logger.log(5, "subvol_selector not set, skipping") |
39 | 30 | return |
40 | 31 |
|
@@ -69,7 +60,7 @@ def mount_subvol(self) -> str: |
69 | 60 | return |
70 | 61 |
|
71 | 62 | source = _get_mount_source(self, self['mounts']['root']) |
72 | | - destination = self['mounts']['root']['destination'] if not self.switch_root_target else self.switch_root_target |
| 63 | + destination = self['mounts']['root']['destination'] if not self.get('switch_root_target') else self['switch_root_target'] |
73 | 64 |
|
74 | 65 | return f"mount -o subvol=$root_subvol {source} {destination}" |
75 | 66 |
|
|
0 commit comments