summaryrefslogtreecommitdiffstats
path: root/tests/utils/getfattr.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils/getfattr.py')
-rwxr-xr-xtests/utils/getfattr.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/utils/getfattr.py b/tests/utils/getfattr.py
index 1a8369af7c4..3eb40e1c887 100755
--- a/tests/utils/getfattr.py
+++ b/tests/utils/getfattr.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python2
+from __future__ import print_function
import os
import sys
from optparse import OptionParser
@@ -32,22 +32,22 @@ def getfattr(path, option):
def print_getfattr (path, option, encoded_attr=None):
if encoded_attr:
if option.encoding == "hex":
- print ("%s=0x%s" % (option.name, encoded_attr))
+ print(("%s=0x%s" % (option.name, encoded_attr)))
elif option.encoding == "base64":
- print ("%s=0s%s" % (option.name, encoded_attr))
+ print(("%s=0s%s" % (option.name, encoded_attr)))
else:
- print ("%s=\"%s\"" % (option.name, encoded_attr))
+ print(("%s=\"%s\"" % (option.name, encoded_attr)))
else:
- print option.name
+ print(option.name)
return
def print_header (path, absnames):
if absnames:
- print ("# file: %s" % path)
+ print(("# file: %s" % path))
else:
print ("getfattr: Removing leading '/' from absolute path names")
- print ("# file: %s" % path[1:])
+ print(("# file: %s" % path[1:]))
if __name__ == '__main__':
usage = "usage: %prog [-n name|-d] [-e en] [-m pattern] path...."
@@ -64,7 +64,7 @@ if __name__ == '__main__':
" them. Valid values of [en] are `text`, `hex`,"
" and `base64`. Values encoded as text strings are"
" enclosed in double quotes (\"), while strings"
- " encoded as hexidecimal and base64 are prefixed with"
+ " encoded as hexadecimal and base64 are prefixed with"
" 0x and 0s, respectively.")
parser.add_option("-m", action="store", dest="pattern", type="string",
help="Only include attributes with names matching the"
@@ -99,8 +99,8 @@ if __name__ == '__main__':
if (not (option.encoding.strip() == "hex" or
option.encoding.strip() == "base64" or
option.encoding.strip() == "text")):
- print ("unrecognized encoding parameter... %s, please use"
- " `text`, `base64` or `hex`" % option.encoding)
+ print(("unrecognized encoding parameter... %s, please use"
+ " `text`, `base64` or `hex`" % option.encoding))
sys.exit(1)
args[0] = os.path.abspath(args[0])
@@ -110,7 +110,7 @@ if __name__ == '__main__':
try:
getfattr(args[0], option)
except KeyError as err:
- print ("Invalid key %s" % err)
+ print(("Invalid key %s" % err))
sys.exit(1)
except IOError as err:
print (err)