Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions diskutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from constants import MultipathConfig
import fcntl
import glob
import subprocess
import shutil
import util
import netutil
Expand All @@ -23,7 +24,11 @@
def mpath_cli_is_working():
regex = re.compile("switchgroup")
try:
(rc,stdout) = util.runCmd2(["multipathd","-k"], with_stdout=True, inputtext="help")
proc = subprocess.Popen(["multipathd", "-k"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
stdin=subprocess.PIPE, text=True)
stdout, stderr = proc.communicate(input="help")
m=regex.search(stdout)
return bool(m)
except:
Expand Down Expand Up @@ -60,7 +65,7 @@ def mpath_enable(mpath_config):
assert 0

# launch manually to make possible to wait initialization
util.runCmd2(["/sbin/multipath", "-v0", "-B"])
util.runCmd2(["/sbin/multipath", "-v0"])
time.sleep(1)
util.runCmd2(util.udevsettleCmd())

Expand Down
2 changes: 1 addition & 1 deletion init
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def main(args):

try:
installer_version = subprocess.check_output(
['rpm', '-q', '--qf', '%{VERSION}-%{RELEASE}', 'host-installer'])
['rpm', '-q', '--qf', '%{VERSION}-%{RELEASE}', 'host-installer'], text=True)
except Exception:
installer_version = 'unknown'

Expand Down