diff --git a/drivers/blktap2.py b/drivers/blktap2.py index b4834e6b6..16a05c5e3 100755 --- a/drivers/blktap2.py +++ b/drivers/blktap2.py @@ -193,55 +193,6 @@ def _mkcmd(cls, args): return __next_mkcmd(args) - @classmethod - def failwith(cls, status, prev=False): - """ - Fail next invocation with @status. If @prev is true, execute - the original command - """ - - __prev_mkcmd = cls.__next_mkcmd - - @classmethod - def __mkcmd(cls, args): - if prev: - cmd = __prev_mkcmd(args) - cmd = "'%s' && exit %d" % ("' '".join(cmd), status) - else: - cmd = "exit %d" % status - - return [ '/bin/sh', '-c', cmd ] - - cls.__next_mkcmd = __mkcmd - - __strace_n = 0 - - @classmethod - def strace(cls): - """ - Run next invocation through strace. - Output goes to /tmp/tap-ctl..; counts invocations. - """ - - __prev_mkcmd = cls.__next_mkcmd - - @classmethod - def __next_mkcmd(cls, args): - - # pylint: disable = E1101 - - cmd = __prev_mkcmd(args) - - tracefile = "/tmp/%s.%d.%d" % (os.path.basename(cls.PATH), - os.getpid(), - cls.__strace_n) - cls.__strace_n += 1 - - return \ - [ '/usr/bin/strace', '-o', tracefile, '--'] + cmd - - cls.__next_mkcmd = __next_mkcmd - @classmethod def _call(cls, args, quiet = False, input = None): """