Skip to content

Commit

Permalink
Switch xapi-storage-scripts tests to python3
Browse files Browse the repository at this point in the history
With this a "make test" after build out of OPAM on Debian 12 finishes
successfully.

Signed-off-by: Yann Dirson <[email protected]>
  • Loading branch information
ydirson authored and psafont committed Jan 24, 2024
1 parent 0ed86ea commit 01753c5
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
Copyright (C) Citrix Systems, Inc.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
Copyright (C) Citrix Systems, Inc.
"""

import os
import sys
import urlparse
import urllib.parse
import xapi.storage.api.volume

import plugin
Expand All @@ -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'],
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand All @@ -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'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
Copyright (C) Citrix Systems, Inc.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

"""
Copyright (C) Citrix Systems, Inc.
"""

import os
import sys
import urlparse
import urllib.parse
import xapi.storage.api.v5.volume

import plugin
Expand All @@ -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'],
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand All @@ -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'],
Expand Down

0 comments on commit 01753c5

Please sign in to comment.