Skip to content

Commit

Permalink
Incorporated review comments
Browse files Browse the repository at this point in the history
- changed API
- other fixes
  • Loading branch information
japokorn committed Oct 23, 2023
1 parent 3258334 commit 0514047
Show file tree
Hide file tree
Showing 9 changed files with 900 additions and 321 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/anaconda_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
podman run -i --rm -v ./blivet:/blivet:z -v ./anaconda:/anaconda:z quay.io/rhinstaller/anaconda-ci:$TARGET_BRANCH sh -c " \
set -xe; \
dnf remove -y python3-blivet; \
dnf install -y python3-blockdev libblockdev-plugins-all python3-bytesize libbytesize python3-pyparted parted libselinux-python3; \
dnf install -y python3-blockdev libblockdev-plugins-all python3-bytesize libbytesize python3-pyparted python3-libmount parted libselinux-python3; \
cd /blivet; \
python3 ./setup.py install; \
cd /anaconda; \
Expand Down
14 changes: 10 additions & 4 deletions blivet/actionlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ def process(self, callbacks=None, devices=None, fstab=None, dry_run=None):
if dry_run:
continue

# get (b)efore (a)ction.(e)xecute fstab entry
# (device may not exist afterwards)
if fstab is not None:
entry = fstab.entry_from_device(action.device)
bae_entry = fstab.find_entry(entry=entry)

with blivet_lock:

try:
Expand Down Expand Up @@ -314,11 +320,11 @@ def process(self, callbacks=None, devices=None, fstab=None, dry_run=None):
device.update_name()
device.format.device = device.path

if fstab is not None:
fstab.update(devices)
fstab.write()

self._completed_actions.append(self._actions.pop(0))
_callbacks.action_executed(action=action)

if fstab is not None:
fstab.update(action, bae_entry)
fstab.write()

self._post_process(devices=devices)
5 changes: 4 additions & 1 deletion blivet/blivet.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
log = logging.getLogger("blivet")


FSTAB_PATH = "/etc/fstab"


@six.add_metaclass(SynchronizedMeta)
class Blivet(object):

Expand All @@ -74,7 +77,7 @@ def __init__(self):

# fstab write location purposedly set to None. It has to be overriden
# manually when using blivet.
self.fstab = FSTabManager(src_file="/etc/fstab", dest_file=None)
self.fstab = FSTabManager(src_file=FSTAB_PATH, dest_file=None)

self._short_product_name = 'blivet'

Expand Down
Loading

0 comments on commit 0514047

Please sign in to comment.