Skip to content

Commit 6b071db

Browse files
authored
Revert "CP-45981: Update xenopsd from python2 to python3"
1 parent 4bb119c commit 6b071db

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

ocaml/xenopsd/scripts/common.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3
1+
#!/usr/bin/python
22
#
33
# Copyright (c) 2011-2013 Citrix Systems, Inc.
44
#
@@ -101,7 +101,7 @@ def add_to_bridge(mode, dev, bridge, address, external_ids):
101101
cmd = ["ovs-vsctl", "--timeout=30", "--", "--if-exists", "del-port", dev, "--", "add-port", bridge, dev]
102102
for (key, value) in external_ids:
103103
cmd = cmd + ["--", "set", "interface", dev, 'external-ids:"%s"="%s"' % (key, value) ]
104-
run(ON_ERROR_LOG, cmd)
104+
run(ON_ERROR_LOG, cmd)
105105

106106
def remove_from_bridge(mode, dev, bridge):
107107
if mode == MODE_BRIDGE:
@@ -206,11 +206,11 @@ def get_words(value, separator):
206206
private = self.json["extra_private_keys"]
207207
if "locking_mode" in self.json:
208208
if type(self.json["locking_mode"]) is list:
209-
# Must be type=locked here
209+
# Must be type=locked here
210210
results["locking_mode"] = self.json["locking_mode"][0].lower()
211-
locked_params=self.json["locking_mode"][1]
212-
results["ipv4_allowed"] = locked_params["ipv4"]
213-
results["ipv6_allowed"] = locked_params["ipv6"]
211+
locked_params=self.json["locking_mode"][1]
212+
results["ipv4_allowed"] = locked_params["ipv4"]
213+
results["ipv6_allowed"] = locked_params["ipv6"]
214214
else:
215215
results["locking_mode"] = self.json["locking_mode"].lower()
216216
send_to_syslog("Got locking config: %s" % (repr(results)))

ocaml/xenopsd/scripts/igmp_query_injector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python
22
import argparse
33
import threading
44
import logging
@@ -106,7 +106,7 @@ def _inject_with_connection_state_check(self):
106106
t.join(self.vif_connected_timeout)
107107
if watcher.watches:
108108
log.warning('Wait vif state change timeout')
109-
for vif in watcher.watches.values():
109+
for vif in watcher.watches.itervalues():
110110
log.warning("Vif:%s state did not change to '%s', don't inject IGMP query to mac: %s" %
111111
(vif, VIF_CONNECTED_STATE, get_vif_mac(vif)))
112112

ocaml/xenopsd/scripts/pygrub-wrapper

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python3
1+
#! /usr/bin/python
22
#
33
# Copyright (C) 2023 Cloud Software Group
44
#
@@ -12,7 +12,7 @@
1212
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
# GNU Lesser General Public License for more details.
1414

15-
15+
from __future__ import print_function
1616
import pwd, subprocess, sys
1717

1818
cmd = ["pygrub"]

ocaml/xenopsd/scripts/qemu-vif-script

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/usr/bin/env python3
2-
1+
#!/usr/bin/env python
32

3+
from __future__ import print_function
44
from common import *
55

66
if __name__ == "__main__":

ocaml/xenopsd/scripts/qemu-wrapper

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python3
1+
#! /usr/bin/python
22
#
33
# Copyright (C) 2016 Citrix Systems R&D Ltd.
44
#
@@ -12,7 +12,7 @@
1212
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313
# GNU Lesser General Public License for more details.
1414

15-
15+
from __future__ import print_function
1616
import os
1717
import re
1818
import sys

ocaml/xenopsd/scripts/setup-vif-rules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python3
1+
#!/usr/bin/python
22
#
33
# Copyright (c) 2011 Citrix Systems, Inc.
44
#
@@ -13,7 +13,7 @@
1313
# GNU Lesser General Public License for more details.
1414
#
1515

16-
16+
from __future__ import print_function
1717
import fcntl
1818
import os
1919
import os.path
@@ -196,7 +196,7 @@ def clear_xs_ofport_path(vif):
196196

197197
def make_vswitch_external_ids(vif):
198198
args = []
199-
for (k, v) in list(vif.get_external_ids().items()):
199+
for (k, v) in vif.get_external_ids().items():
200200
args += ["--", "set", "interface", vif.vif_name, 'external-ids:"%s"="%s"' % (k, v)]
201201
return args
202202

0 commit comments

Comments
 (0)