From ad9cd13c2c83d255d5a9085d48cd6f6c6992eae7 Mon Sep 17 00:00:00 2001 From: Phil Bridges Date: Tue, 21 Jun 2016 18:24:38 -0500 Subject: [PATCH] Fix 'dummy' HPSS ioctl code In order for the unit test suite to run happily without HPSS installed, some dummy implementation of the ioctl() call normally given by the 'hpssfs' module needed to be added. This was done when bringing the code into a known good state, but the implementation would not actually work and that seemed like it would be an issue down the road. So here's an actually working implementation of that. Change-Id: I52c8ede8ac2d38bb59c2d7d2fb399fd65e75577a --- swiftonhpss/swift/common/hpssfs_ioctl.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/swiftonhpss/swift/common/hpssfs_ioctl.py b/swiftonhpss/swift/common/hpssfs_ioctl.py index fbdeb1e..9dff94f 100644 --- a/swiftonhpss/swift/common/hpssfs_ioctl.py +++ b/swiftonhpss/swift/common/hpssfs_ioctl.py @@ -34,7 +34,8 @@ HPSSFS_UNDELETE_OVERWRITE_AND_RESTORE = 0x00000003 def ioctl(fd, cmd, val=None): if val is not None: - valbuf = array.array("i", val) - fcntl.ioctl(fd, cmd, valbuf) + valbuf = array.array('i', [0]) else: - fcntl.ioctl(fd, cmd) + valbuf = array.array('i', [val]) + fcntl.ioctl(fd, cmd, valbuf) + return valbuf[0]