[PATCH 1/2] Add a function to tell us if the lvmetad socket exists.

David Lehman dlehman at redhat.com
Thu Sep 17 18:26:24 UTC 2015


(cherry picked from commit 91bf114fe431a51f0d76588071801c046eaf67f3)

Related: rhbz#1261621
---
 blivet/devicelibs/lvm.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
index 41cd6f9..00124e2 100644
--- a/blivet/devicelibs/lvm.py
+++ b/blivet/devicelibs/lvm.py
@@ -21,7 +21,9 @@
 #
 
 import math
+import os
 from decimal import Decimal
+
 from collections import namedtuple
 
 import logging
@@ -62,6 +64,8 @@ def has_lvm():
 
     return False
 
+LVMETAD_SOCKET_PATH = "/run/lvm/lvmetad.socket"
+
 # Start config_args handling code
 #
 # Theoretically we can handle all that can be handled with the LVM --config
@@ -714,3 +718,6 @@ def lvcreate_cached(vg_name, lv_name, lv_size, cache_data_size, cache_md_size,
                                                                        vg_lv_name(lv_name),
                                                                        msg)
         raise LVMError(msg)
+
+def lvmetad_socket_exists():
+    return os.path.exists(LVMETAD_SOCKET_PATH)
-- 
2.4.3



More information about the anaconda-patches mailing list