Skip to content

Commit d87b53a

Browse files
committed
Address pylint issues flagged by newer pylint in github actions
Signed-off-by: Mark Syms <mark.syms@cloud.com>
1 parent 3cb87cd commit d87b53a

File tree

7 files changed

+13
-3
lines changed

7 files changed

+13
-3
lines changed

drivers/LUNperVDI.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def create(self, sr_uuid, vdi_uuid, size):
8282
VDIs = util._getVDIs(self.sr)
8383
self.sr._loadvdis()
8484
smallest = 0
85+
v = None
8586
for vdi in VDIs:
8687
if not vdi['managed'] \
8788
and int(vdi['virtual_size']) >= int(size) \

drivers/LVHDSR.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ def load(self, sr_uuid):
205205
re.compile("^.*[0-9a-f]{8}-(([0-9a-f]{4})-){3}[0-9a-f]{12}.*")
206206
self.storageVDIs = {}
207207

208+
vdi = None
208209
for key in self.lvmCache.lvs.keys():
209210
# if the lvname has a uuid in it
210211
type = None
@@ -969,6 +970,7 @@ def _undoCloneOp(self, lvs, origUuid, baseUuid, clonUuid):
969970
origRefcountNormal = 0
970971

971972
# un-hide the parent
973+
vhdInfo = None
972974
if base.vdiType == vhdutil.VDI_TYPE_VHD:
973975
self.lvActivator.activate(baseUuid, base.name, False)
974976
origRefcountNormal = 1

drivers/SR.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ def __init__(self, srcmd, sr_uuid):
153153

154154
@staticmethod
155155
def from_uuid(session, sr_uuid):
156-
import imp
156+
import importlib.machinery
157+
import types
157158

158159
_SR = session.xenapi.SR
159160
sr_ref = _SR.get_by_uuid(sr_uuid)
@@ -169,7 +170,9 @@ def from_uuid(session, sr_uuid):
169170
driver_real = os.path.realpath(driver_path)
170171
module_name = os.path.basename(driver_path)
171172

172-
module = imp.load_source(module_name, driver_real)
173+
loader = importlib.machinery.SourceFileLoader(module_name, driver_real)
174+
module = types.ModuleType(loader.name)
175+
loader.exec_module(module)
173176
target = driver(sm_type)
174177
# NB. get the host pbd's device_config
175178

@@ -186,6 +189,7 @@ def from_uuid(session, sr_uuid):
186189
# FIXME
187190

188191
from SRCommand import SRCommand
192+
# pylint: disable=E1101
189193
cmd = SRCommand(module.DRIVER_INFO)
190194
cmd.dconf = device_config
191195
cmd.params = {'session_ref': session._session,

drivers/cleanup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3489,6 +3489,7 @@ def main():
34893489
background = False
34903490
force = False
34913491
dryRun = False
3492+
maxAge = 0
34923493
debug_cmd = ""
34933494
vdi_uuid = ""
34943495
shortArgs = "gGc:aqxu:bfdt:v:"

drivers/iscsilib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def get_node_config (portal, targetIQN):
248248
ini_sec = "root"
249249
str_fp = io.StringIO("[%s]\n%s" % (ini_sec, stdout))
250250
parser = RawConfigParser()
251-
parser.readfp(str_fp)
251+
parser.read_file(str_fp)
252252
str_fp.close()
253253
return dict(parser.items(ini_sec))
254254

drivers/mpathcount.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def match_dmpLUN(s):
8484

8585

8686
def match_pathup(s):
87+
path_status = None
8788
match = re.match(r'.*\d+:\d+:\d+:\d+\s+\S+\s+\S+\s+\S+\s+(\S+)', s)
8889
if match:
8990
path_status = match.group(1)

drivers/resetvdis.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import cleanup
2222
import util
2323
import lock
24+
import sys
2425
import XenAPI # pylint: disable=import-error
2526

2627

0 commit comments

Comments
 (0)