Skip to contentSkip to conversation

main - lvmdbustest: Check for needed env. variables

PATCH Tony Asleson 1 participant 1 message Mar 10, 2023

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f8876290bfc8d11400901e9eac32f6d613b0ed70
Commit:        f8876290bfc8d11400901e9eac32f6d613b0ed70
Parent:        568e8c71d7e39da7494a470400d3f9977c13a1c7
Author:        Tony Asleson <[email protected]>
AuthorDate:    Fri Mar 10 10:41:50 2023 -0600
Committer:     Tony Asleson <[email protected]>
CommitterDate: Fri Mar 10 12:51:53 2023 -0600

lvmdbustest: Check for needed env. variables

---
 test/dbus/lvm_error_inject.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
test/dbus/lvm_error_inject.py +6 -2
index 2849dd29c..098f87070 100755
@@ -336,8 +336,12 @@ if __name__ == "__main__":
             cmdline.extend(args)
             ec = run_one(cmdline)
         else:
-            SH = LvmShellHandler(cmdline)
-            ec = SH.run()
+            if "LVM_REPORT_FD" in os.environ:
+                SH = LvmShellHandler(cmdline)
+                ec = SH.run()
+            else:
+                debug('running as lvm shell requires: LVM_REPORT_FD to be set')
+                ec = 1
         sys.exit(ec)
     except Exception:
         traceback.print_exc(file=d_out)