summaryrefslogtreecommitdiffstats
path: root/extras/volfilter.py
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2018-04-13 09:13:16 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2018-05-02 11:28:46 +0000
commit4e7b423d3c3137c3f83b71b36279e1a544154833 (patch)
treee59dc57aa319a5e145161a0e32fba9fc74773e91 /extras/volfilter.py
parent9da91172538a2a95fba609c93e199db159fd1938 (diff)
core/various: python3 compat, prepare for python2 -> python3
see https://review.gluster.org/#/c/19788/ use print fn from __future__ Change-Id: If5075d8d9ca9641058fbc71df8a52aa35804cda4 updates: #411 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'extras/volfilter.py')
-rw-r--r--extras/volfilter.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/extras/volfilter.py b/extras/volfilter.py
index 0ca456a7882..d242e60dcba 100644
--- a/extras/volfilter.py
+++ b/extras/volfilter.py
@@ -13,6 +13,7 @@
# You should have received a copy of the GNU General Public License * along
# with HekaFS. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import print_function
import copy
import string
import sys
@@ -127,16 +128,16 @@ def generate (graph, last, stream=sys.stdout):
for sv in last.subvols:
if not sv.dumped:
generate(graph,sv,stream)
- print >> stream, ""
+ print("", file=stream)
sv.dumped = True
- print >> stream, "volume %s" % last.name
- print >> stream, " type %s" % last.type
+ print("volume %s" % last.name, file=stream)
+ print(" type %s" % last.type, file=stream)
for k, v in last.opts.iteritems():
- print >> stream, " option %s %s" % (k, v)
+ print(" option %s %s" % (k, v), file=stream)
if last.subvols:
- print >> stream, " subvolumes %s" % string.join(
- [ sv.name for sv in last.subvols ])
- print >> stream, "end-volume"
+ print(" subvolumes %s" % string.join(
+ [ sv.name for sv in last.subvols ]), file=stream)
+ print("end-volume", file=stream)
def push_filter (graph, old_xl, filt_type, opts={}):
suffix = "-" + old_xl.type.split("/")[1]