diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-29 10:54:50 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-29 10:54:50 -0500 |
commit | bad42ab94bb518b334521ac5394421e6513d55d8 (patch) | |
tree | 7386ea9186bb87f2042ad57a7be7f27f61e59a0f /hscript | |
parent | 7fbaf52dbd9a9afb406d4a631ff5a1625c90ef64 (diff) | |
download | horizon-bad42ab94bb518b334521ac5394421e6513d55d8.tar.gz horizon-bad42ab94bb518b334521ac5394421e6513d55d8.tar.bz2 horizon-bad42ab94bb518b334521ac5394421e6513d55d8.tar.xz horizon-bad42ab94bb518b334521ac5394421e6513d55d8.zip |
hscript: Only use LVMGroup::test_pv in install env builds
Diffstat (limited to 'hscript')
-rw-r--r-- | hscript/disk.cc | 4 | ||||
-rw-r--r-- | hscript/script.cc | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/hscript/disk.cc b/hscript/disk.cc index 634e56f..bec5d3e 100644 --- a/hscript/disk.cc +++ b/hscript/disk.cc @@ -531,6 +531,7 @@ bool LVMGroup::validate(ScriptOptions) const { } bool LVMGroup::test_pv(ScriptOptions) const { +#ifdef HAS_INSTALL_ENV const char *fstype = blkid_get_tag_value(nullptr, "TYPE", this->pv().c_str()); if(fstype == nullptr) { @@ -539,6 +540,9 @@ bool LVMGroup::test_pv(ScriptOptions) const { } return (strcmp(fstype, "LVM2_member") == 0); +#else + return true; +#endif } bool LVMGroup::execute(ScriptOptions) const { diff --git a/hscript/script.cc b/hscript/script.cc index 9913b2a..357ed15 100644 --- a/hscript/script.cc +++ b/hscript/script.cc @@ -872,12 +872,14 @@ bool Script::validate() const { if(seen_pvs.find(vg->pv()) == seen_pvs.end()) { /* Okay, let's see if a PV already exists there... */ if(opts.test(InstallEnvironment)) { +#ifdef HAS_INSTALL_ENV if(!vg->test_pv(opts)) { failures++; output_error("installfile:" + std::to_string(vg->lineno()), "lvm_vg: a physical volume does not exist on " + vg->pv()); } +#endif } else { /* We can't tell if we aren't running on the target. */ output_warning("installfile:" + std::to_string(vg->lineno()), |