From 1ecff5a861115408becbebb5a86597c3a77d878f Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Thu, 18 Jan 2024 17:33:46 +0100 Subject: [PATCH] Switch xapi-storage-scripts tests to python3 With this a "make test" after build out of OPAM on Debian 12 finishes successfully. Signed-off-by: Yann Dirson --- .../test/volume/org.xen.xapi.storage.dummy/plugin.py | 2 +- .../test/volume/org.xen.xapi.storage.dummy/sr.py | 10 +++++----- .../test/volume/org.xen.xapi.storage.dummy/volume.py | 10 +++++----- .../test/volume/org.xen.xapi.storage.dummyv5/plugin.py | 2 +- .../test/volume/org.xen.xapi.storage.dummyv5/sr.py | 10 +++++----- .../test/volume/org.xen.xapi.storage.dummyv5/volume.py | 10 +++++----- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/plugin.py b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/plugin.py index 08fb78407e0..40e3a00911c 100755 --- a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/plugin.py +++ b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/plugin.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 """ Copyright (C) Citrix Systems, Inc. diff --git a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/sr.py b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/sr.py index 3cd7a211c8f..82c77d891db 100755 --- a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/sr.py +++ b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/sr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 """ Copyright (C) Citrix Systems, Inc. @@ -6,7 +6,7 @@ import os import sys -import urlparse +import urllib.parse import xapi.storage.api.volume import plugin @@ -21,11 +21,11 @@ def create(self, dbg, uri, name, description, configuration): return def detach(self, dbg, sr): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) return def ls(self, dbg, sr): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) qr = plugin.Implementation().query(dbg) return [{ "name": qr['name'], @@ -40,7 +40,7 @@ def ls(self, dbg, sr): }] def stat(self, dbg, sr): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) qr = plugin.Implementation().query(dbg) return { "sr": sr, diff --git a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/volume.py b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/volume.py index 448ee6dcbc3..848c13bfd39 100755 --- a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/volume.py +++ b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummy/volume.py @@ -1,11 +1,11 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 """ Copyright (C) Citrix Systems, Inc. """ import uuid -import urlparse +import urllib.parse import os import sys import xapi.storage.api.volume @@ -17,7 +17,7 @@ class Implementation(xapi.storage.api.volume.Volume_skeleton): def create(self, dbg, sr, name, description, size): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) voluuid = str(uuid.uuid4()) return { "name": name, @@ -32,11 +32,11 @@ def create(self, dbg, sr, name, description, size): } def destroy(self, dbg, sr, key): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) return def stat(self, dbg, sr, key): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) qr = plugin.Implementation().query(dbg) return { "name": qr['name'], diff --git a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/plugin.py b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/plugin.py index 5816f0dd217..e9ef122ca07 100755 --- a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/plugin.py +++ b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/plugin.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 """ Copyright (C) Citrix Systems, Inc. diff --git a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/sr.py b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/sr.py index 6100407e91d..3c649423d15 100755 --- a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/sr.py +++ b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/sr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 """ Copyright (C) Citrix Systems, Inc. @@ -6,7 +6,7 @@ import os import sys -import urlparse +import urllib.parse import xapi.storage.api.v5.volume import plugin @@ -22,11 +22,11 @@ def create(self, dbg, uuid, configuration, name, description): return configuration def detach(self, dbg, sr): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) return def ls(self, dbg, sr): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) qr = plugin.Implementation().query(dbg) return [{ "name": qr['name'], @@ -42,7 +42,7 @@ def ls(self, dbg, sr): }] def stat(self, dbg, sr): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) qr = plugin.Implementation().query(dbg) return { "sr": sr, diff --git a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/volume.py b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/volume.py index 20822dd8d73..fcf52ce3883 100755 --- a/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/volume.py +++ b/ocaml/xapi-storage-script/test/volume/org.xen.xapi.storage.dummyv5/volume.py @@ -1,11 +1,11 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 """ Copyright (C) Citrix Systems, Inc. """ import uuid -import urlparse +import urllib.parse import os import sys import xapi.storage.api.v5.volume @@ -17,7 +17,7 @@ class Implementation(xapi.storage.api.v5.volume.Volume_skeleton): def create(self, dbg, sr, name, description, size, sharable): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) voluuid = str(uuid.uuid4()) return { "name": name, @@ -33,11 +33,11 @@ def create(self, dbg, sr, name, description, size, sharable): } def destroy(self, dbg, sr, key): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) return def stat(self, dbg, sr, key): - urlparse.urlparse(sr) + urllib.parse.urlparse(sr) qr = plugin.Implementation().query(dbg) return { "name": qr['name'],