Skip to content

Commit eb61fcf

Browse files
committed
fix regression in btrfs.py
Signed-off-by: Zen <[email protected]>
1 parent 89884cc commit eb61fcf

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

src/ugrd/fs/btrfs.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,31 @@
1-
__version__ = '0.6.0'
1+
__version__ = '0.6.2'
22
__author__ = 'desultory'
33

44
from ugrd.fs.mounts import _get_mount_source
55

66

77
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 """
129
self.update({'root_subvol': root_subvol})
1310
self.logger.debug("Set root_subvol to: %s", root_subvol)
1411

1512

1613
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. """
2015
if subvol_selector:
2116
self.update({'subvol_selector': subvol_selector})
2217
self.logger.debug("Set subvol_selector to: %s", subvol_selector)
2318
self['paths'] = self['base_mount_path']
2419

2520

2621
def btrfs_scan(self) -> str:
27-
"""
28-
sccans for new mounts
29-
"""
22+
""" scan for new btrfs devices. """
3023
return "btrfs device scan"
3124

3225

3326
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'):
3829
self.logger.log(5, "subvol_selector not set, skipping")
3930
return
4031

@@ -69,7 +60,7 @@ def mount_subvol(self) -> str:
6960
return
7061

7162
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']
7364

7465
return f"mount -o subvol=$root_subvol {source} {destination}"
7566

src/ugrd/initramfs_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def load_config(self) -> None:
4646
# Process into the config dict, it should handle parsing
4747
for config, value in raw_config.items():
4848
self.logger.debug("Processing config key: %s" % config)
49-
self.config_dict[config] = value
49+
self[config] = value
5050

5151
self.logger.debug("Loaded config:\n%s" % self.config_dict)
5252

@@ -211,7 +211,7 @@ def generate_init(self) -> None:
211211

212212
def pack_build(self) -> None:
213213
"""
214-
Packs the initramfs based on self.config_dict['imports']['pack']
214+
Packs the initramfs based on self['imports']['pack']
215215
"""
216216
if self['imports'].get('pack'):
217217
self._run_hook('pack')

0 commit comments

Comments
 (0)