>I know this was a tip from the systemd guys, but thinking about it a little bit more -- wouldn't it be better to have a initial-setup-reconfig.service with ConditionPathExists=/.unconfigured just triggering initial-setup.service? AFAICT that condition is checked by systemd and is thus much faster/cheaper than running a bash script on every system boot just to find out that the file doesn't exist.
No problem - I would certainly also prefer something less costly than running a shell script on every boot. I just wonder if it might have some requirements that make it unusable in this use case so that they did not suggest it instead of writing a generator. I guess I'll have to investigate. :)
--
To view this pull request on github, visit https://github.com/rhinstaller/initial-setup/pull/8
I know this was a tip from the systemd guys, but thinking about it a little bit more -- wouldn't it be better to have a ``initial-setup-reconfig.service`` with ``ConditionPathExists=/.unconfigured`` just triggering ``initial-setup.service``? AFAICT that condition is checked by systemd and is thus much faster/cheaper than running a bash script on every system boot just to find out that the file doesn't exist.
--
To view this pull request on github, visit https://github.com/rhinstaller/initial-setup/pull/8
> @@ -110,6 +118,21 @@ def __init__(self, gui_mode):
> setup_ifcfg_log()
>
> @property
> + def external_reconfig(self):
> + """External reconfig status.
> +
> + Reports if external (eq. not triggered by kickstart) has been enabled.
> +
> + :returns: True if external reconfig mode has been enabled, else False.
> + :rtype: bool
> + """
> + return self._external_reconfig
Would it make sense to determine the value here if it's not set? (i.e. set it to ``None`` in ``__init__``)
--
To view this pull request on github, visit https://github.com/rhinstaller/initial-setup/pull/8#discussion_r65037514
> @@ -70,7 +68,17 @@ def __init__(self, gui_mode):
> else:
> log.debug("running in TUI mode")
>
> - if external_reconfig:
> + self._external_reconfig = False
> +
> + # check if the reconfig mode should be enabled
> + # by checking if at least one of the reconfig
> + # files exist
> + for reconfig_file in RECONFIG_FILES:
> + if os.path.exists(reconfig_file):
> + self.external_reconfig = True
This could be nicely written as:
``self.external_reconfig = any(os.path.exists(path) for path in RECONFIG_FILES)``
which I personally find better readable, but YMMV.
--
To view this pull request on github, visit https://github.com/rhinstaller/initial-setup/pull/8#discussion_r65037386
When a LV is on top of a RAID, and the RAID is not fully synced, it
appears that it can take a significant (1s or more) for the LV's path to
appear under /dev/mapper, causing problems when trying to immediately
wipe the filesystem from the LV before tearing down the LV, VG, PV and
RAID.
So, this adds a check to make sure the LV's path exists before declaring
that it has been auto-activated.
Resolves: rhbz#1325707
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/431
From: "Brian C. Lane" <bcl(a)redhat.com>
When a LV is on top of a RAID, and the RAID is not fully synced, it
appears that it can take a significant (1s or more) amount of time for
the LV's path to appear under /dev/mapper, causing problems when trying
to immediately wipe the filesystem from the LV before tearing down the
LV, VG, PV and RAID.
So, this adds a check to DMDevice.status make sure the path exists
before returning True.
Resolves: rhbz#1325707
---
blivet/devices/dm.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/dm.py b/blivet/devices/dm.py
index 9326786..777d11f 100644
--- a/blivet/devices/dm.py
+++ b/blivet/devices/dm.py
@@ -100,7 +100,8 @@ def mapName(self):
def status(self):
match = next((m for m in block.dm.maps() if m.name == self.mapName),
None)
- return (match.live_table and not match.suspended) if match else False
+ return super(DMDevice, self).status and \
+ (match.live_table and not match.suspended) if match else False
#def getTargetType(self):
# return dm.getDmTarget(name=self.name)
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/5e99a4d1a87f8e00941f61771790c8…
If `DMDevice.status` doesn't work right you should factor the `StorageDevice.status` value into it so everyone gets the benefit.
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/431