Change in vdsm[master]: drop execCmd(raw)

2017-08-05 Thread Code Review
From Dan Kenigsberg :

Dan Kenigsberg has posted comments on this change.

Change subject: drop execCmd(raw)
..


Patch Set 2: Code-Review-1

nope, there's still plenty of code using the depending on raw=False.

-- 
To view, visit https://gerrit.ovirt.org/80214
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2ab6d9dca564da2dd61923888fad0be94afee8c9
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg 
Gerrit-Reviewer: Dan Kenigsberg 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[master]: drop execCmd(raw)

2017-08-05 Thread Code Review
From Dan Kenigsberg :

Dan Kenigsberg has uploaded a new change for review.

Change subject: drop execCmd(raw)
..

drop execCmd(raw)

The `raw` argument was ill-conceived, as it modified the type of the
output of execCmd. Nowadays we use only raw=True, so we can safely drop
it.

Change-Id: I2ab6d9dca564da2dd61923888fad0be94afee8c9
Signed-off-by: Dan Kenigsberg 
---
M lib/vdsm/commands.py
M lib/vdsm/gluster/gfapi.py
M lib/vdsm/hooks.py
M lib/vdsm/host/__init__.py
M lib/vdsm/mkimage.py
M lib/vdsm/numa.py
M lib/vdsm/storage/clusterlock.py
M lib/vdsm/storage/fuser.py
M lib/vdsm/storage/mailbox.py
M lib/vdsm/storage/misc.py
M lib/vdsm/storage/multipath.py
M lib/vdsm/storage/qemuimg.py
M lib/vdsm/supervdsm_api/containers.py
M lib/vdsm/tool/configurators/certificates.py
M lib/vdsm/tool/configurators/lvm.py
M lib/vdsm/tool/configurators/sanlock.py
M lib/vdsm/udevadm.py
M lib/vdsm/v2v.py
M lib/vdsm/virt/containers/command.py
M tests/cmdutils_test.py
M tests/commands_test.py
M tests/containers/conttestlib.py
M tests/loopback.py
M tests/mkimage_test.py
M tests/storage/mount_test.py
M tests/storage/storagetestlib.py
M tests/v2v_test.py
M vdsm_hooks/hostusb/after_vm_destroy.py
M vdsm_hooks/hostusb/before_vm_start.py
M vdsm_hooks/localdisk/after_disk_prepare
M vdsm_hooks/localdisk/localdisk-helper
M vdsm_hooks/openstacknet/openstacknet_utils.py
M vdsm_hooks/promisc/after_vm_start.py
M vdsm_hooks/promisc/before_vm_destroy.py
M vdsm_hooks/scratchpad/before_vm_start.py
35 files changed, 53 insertions(+), 61 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/80214/1

diff --git a/lib/vdsm/commands.py b/lib/vdsm/commands.py
index 2041b30..438e839 100644
--- a/lib/vdsm/commands.py
+++ b/lib/vdsm/commands.py
@@ -42,7 +42,7 @@
 BUFFSIZE = 1024
 
 
-def execCmd(command, sudo=False, cwd=None, data=None, raw=False,
+def execCmd(command, sudo=False, cwd=None, data=None,
 printable=None, env=None, sync=True, nice=None, ioclass=None,
 ioclassdata=None, setsid=False, execCmdLogger=logging.root,
 deathSignal=None, resetCpuAffinity=True):
@@ -92,10 +92,6 @@
 out = ""
 
 execCmdLogger.debug(retcode_log_line(p.returncode, err=err))
-
-if not raw:
-out = out.splitlines(False)
-err = err.splitlines(False)
 
 return p.returncode, out, err
 
diff --git a/lib/vdsm/gluster/gfapi.py b/lib/vdsm/gluster/gfapi.py
index dc455be..00eaf19 100644
--- a/lib/vdsm/gluster/gfapi.py
+++ b/lib/vdsm/gluster/gfapi.py
@@ -227,7 +227,7 @@
 env['PYTHONPATH'] = ":".join(map(os.path.abspath,
  env['PYTHONPATH'].split(":")))
 
-rc, out, err = commands.execCmd(command, raw=True, env=env)
+rc, out, err = commands.execCmd(command, env=env)
 if rc != 0:
 raise ge.GlfsStatvfsException(rc, [out], [err])
 res = json.loads(out)
@@ -258,7 +258,7 @@
 env['PYTHONPATH'] = ":".join(map(os.path.abspath,
  env['PYTHONPATH'].split(":")))
 
-rc, out, err = commands.execCmd(command, raw=True, env=env)
+rc, out, err = commands.execCmd(command, env=env)
 if rc != 0:
 raise ge.GlusterVolumeEmptyCheckFailedException(rc, [out], [err])
 return out.upper() == "TRUE"
diff --git a/lib/vdsm/hooks.py b/lib/vdsm/hooks.py
index f7e9fdf..5d5e4d1 100644
--- a/lib/vdsm/hooks.py
+++ b/lib/vdsm/hooks.py
@@ -104,7 +104,7 @@
 
 errorSeen = False
 for s in scripts:
-rc, out, err = commands.execCmd([s], raw=True,
+rc, out, err = commands.execCmd([s],
 env=scriptenv)
 logging.info(err)
 if rc != 0:
diff --git a/lib/vdsm/host/__init__.py b/lib/vdsm/host/__init__.py
index 14e01b8..47f8c0d 100644
--- a/lib/vdsm/host/__init__.py
+++ b/lib/vdsm/host/__init__.py
@@ -44,7 +44,6 @@
 ret, out, err = execCmd([constants.EXT_DMIDECODE,
  "-s",
  "system-uuid"],
-raw=True,
 sudo=True)
 out = '\n'.join(line for line in out.splitlines()
 if not line.startswith('#'))
diff --git a/lib/vdsm/mkimage.py b/lib/vdsm/mkimage.py
index a76fca5..c630f24 100644
--- a/lib/vdsm/mkimage.py
+++ b/lib/vdsm/mkimage.py
@@ -123,7 +123,7 @@
 command = [EXT_MKFS_MSDOS, '-C', floppy, '1440']
 if volumeName is not None:
 command.extend(['-n', volumeName])
-rc, out, err = execCmd(command, raw=True)
+rc, out, err = execCmd(command)
 if rc:
 raise OSError(errno.EIO, "could not create floppy file: "
   "code %s, out %s\nerr %s" % (rc, out, err))
@@ -158,7 +158,7 @@
 fd = os.open(isopath, os.O_CREAT |