From 373f428fc2c6e258baa3ba7078ead96fde305d8c Mon Sep 17 00:00:00 2001 From: Kaifeng Wang Date: Fri, 3 Jan 2020 15:47:41 +0800 Subject: [PATCH] Make qemu hook running with python3 This switches the piece of code turns on multicast [1] to run with python3. [1] https://review.opendev.org/#/c/665221 Change-Id: I12d3764d087fa19aca5b285cbd63a19b1770bb41 --- devstack/files/hooks/qemu.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/devstack/files/hooks/qemu.py b/devstack/files/hooks/qemu.py index 872d5e1014..75ecba9c7e 100755 --- a/devstack/files/hooks/qemu.py +++ b/devstack/files/hooks/qemu.py @@ -1,4 +1,4 @@ -#!/usr/bin/python -tt +#!/usr/bin/python3 # Copyright (c) 2017 Intel Corporation # @@ -45,10 +45,9 @@ def main(): action = sys.argv[2] if action == "started": - interfaces = str( - subprocess.check_output( - ['ip', 'link', 'show', 'type', 'macvtap'] - )).split("\n") + interfaces = subprocess.check_output( + ['ip', 'link', 'show', 'type', 'macvtap'] + ).decode().split("\n") for iface_line in interfaces: if 'macvtap' in iface_line: iface_string = iface_line.split('@')