Skip to content

Commit

Permalink
Merge pull request #5274 from xapi-project/revert-5259-private/stephe…
Browse files Browse the repository at this point in the history
…nche/CP-45981

Revert "CP-45981: Update xenopsd from python2 to python3"
  • Loading branch information
edwintorok authored Dec 1, 2023
2 parents 4bb119c + ac4102f commit 0a36c4a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions ocaml/xenopsd/scripts/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/python
#
# Copyright (c) 2011-2013 Citrix Systems, Inc.
#
Expand Down Expand Up @@ -101,7 +101,7 @@ def add_to_bridge(mode, dev, bridge, address, external_ids):
cmd = ["ovs-vsctl", "--timeout=30", "--", "--if-exists", "del-port", dev, "--", "add-port", bridge, dev]
for (key, value) in external_ids:
cmd = cmd + ["--", "set", "interface", dev, 'external-ids:"%s"="%s"' % (key, value) ]
run(ON_ERROR_LOG, cmd)
run(ON_ERROR_LOG, cmd)

def remove_from_bridge(mode, dev, bridge):
if mode == MODE_BRIDGE:
Expand Down Expand Up @@ -206,11 +206,11 @@ def get_words(value, separator):
private = self.json["extra_private_keys"]
if "locking_mode" in self.json:
if type(self.json["locking_mode"]) is list:
# Must be type=locked here
# Must be type=locked here
results["locking_mode"] = self.json["locking_mode"][0].lower()
locked_params=self.json["locking_mode"][1]
results["ipv4_allowed"] = locked_params["ipv4"]
results["ipv6_allowed"] = locked_params["ipv6"]
locked_params=self.json["locking_mode"][1]
results["ipv4_allowed"] = locked_params["ipv4"]
results["ipv6_allowed"] = locked_params["ipv6"]
else:
results["locking_mode"] = self.json["locking_mode"].lower()
send_to_syslog("Got locking config: %s" % (repr(results)))
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xenopsd/scripts/igmp_query_injector.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
import argparse
import threading
import logging
Expand Down Expand Up @@ -106,7 +106,7 @@ def _inject_with_connection_state_check(self):
t.join(self.vif_connected_timeout)
if watcher.watches:
log.warning('Wait vif state change timeout')
for vif in watcher.watches.values():
for vif in watcher.watches.itervalues():
log.warning("Vif:%s state did not change to '%s', don't inject IGMP query to mac: %s" %
(vif, VIF_CONNECTED_STATE, get_vif_mac(vif)))

Expand Down
4 changes: 2 additions & 2 deletions ocaml/xenopsd/scripts/pygrub-wrapper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python3
#! /usr/bin/python
#
# Copyright (C) 2023 Cloud Software Group
#
Expand All @@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.


from __future__ import print_function
import pwd, subprocess, sys

cmd = ["pygrub"]
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xenopsd/scripts/qemu-vif-script
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

#!/usr/bin/env python

from __future__ import print_function
from common import *

if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions ocaml/xenopsd/scripts/qemu-wrapper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python3
#! /usr/bin/python
#
# Copyright (C) 2016 Citrix Systems R&D Ltd.
#
Expand All @@ -12,7 +12,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.


from __future__ import print_function
import os
import re
import sys
Expand Down
6 changes: 3 additions & 3 deletions ocaml/xenopsd/scripts/setup-vif-rules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/python
#
# Copyright (c) 2011 Citrix Systems, Inc.
#
Expand All @@ -13,7 +13,7 @@
# GNU Lesser General Public License for more details.
#


from __future__ import print_function
import fcntl
import os
import os.path
Expand Down Expand Up @@ -196,7 +196,7 @@ def clear_xs_ofport_path(vif):

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

Expand Down

0 comments on commit 0a36c4a

Please sign in to comment.