Skip to content

Commit 31d1b02

Browse files
committed
Fix warns reported by new github workflow
Signed-off-by: Ronan Abhamon <[email protected]>
1 parent 7565097 commit 31d1b02

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

drivers/LUNperVDI.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def create(self, sr_uuid, vdi_uuid, size) -> str:
8787
VDIs = util._getVDIs(self.sr)
8888
self.sr._loadvdis()
8989
smallest = 0
90+
v = {}
9091
for vdi in VDIs:
9192
if not vdi['managed'] \
9293
and int(vdi['virtual_size']) >= int(size) \

drivers/LVHDSR.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def load(self, sr_uuid) -> None:
222222
for key in self.lvmCache.lvs.keys():
223223
# if the lvname has a uuid in it
224224
type = None
225+
vdi = None
225226
if contains_uuid_regex.search(key) is not None:
226227
if key.startswith(lvhdutil.LV_PREFIX[vhdutil.VDI_TYPE_VHD]):
227228
type = vhdutil.VDI_TYPE_VHD
@@ -997,8 +998,8 @@ def _undoCloneOp(self, lvs, origUuid, baseUuid, clonUuid):
997998
self.lvActivator.activate(baseUuid, base.name, False)
998999
origRefcountNormal = 1
9991000
vhdInfo = vhdutil.getVHDInfo(basePath, lvhdutil.extractUuid, False)
1000-
if base.vdiType == vhdutil.VDI_TYPE_VHD and vhdInfo.hidden:
1001-
vhdutil.setHidden(basePath, False)
1001+
if vhdInfo.hidden:
1002+
vhdutil.setHidden(basePath, False)
10021003
elif base.vdiType == vhdutil.VDI_TYPE_RAW and base.hidden:
10031004
self.lvmCache.setHidden(base.name, False)
10041005

drivers/LinstorSR.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,8 +1205,7 @@ def _load_vdis_ex(self):
12051205
if USE_KEY_HASH and vdi.vdi_type == vhdutil.VDI_TYPE_VHD:
12061206
# TODO: Replace pylint comment with this feature when possible:
12071207
# https://github.com/PyCQA/pylint/pull/2926
1208-
vdi.sm_config_override['key_hash'] = \
1209-
self._vhdutil.get_key_hash(vdi_uuid) # pylint: disable = E1120
1208+
vdi.sm_config_override['key_hash'] = self._vhdutil.get_key_hash(vdi_uuid) # pylint: disable = E1120
12101209

12111210
# 4.c. Update CBT status of disks either just added
12121211
# or already in XAPI.

drivers/cleanup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4174,6 +4174,7 @@ def abort_optional_reenable(uuid):
41744174
#
41754175
def main():
41764176
action = ""
4177+
maxAge = 0
41774178
uuid = ""
41784179
background = False
41794180
force = False

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def match_pathup(s):
8989
match = re.match(r'.*\d+:\d+:\d+:\d+\s+\S+\s+\S+\s+\S+\s+(\S+)', s)
9090
if match:
9191
path_status = match.group(1)
92-
if path_status in ['faulty', 'shaky', 'failed']:
93-
return False
92+
if path_status in ['faulty', 'shaky', 'failed']:
93+
return False
9494
return True
9595

9696

drivers/resetvdis.py

Lines changed: 1 addition & 1 deletion
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

@@ -141,7 +142,6 @@ def usage():
141142
sys.exit(1)
142143

143144
if __name__ == '__main__':
144-
import sys
145145
import atexit
146146

147147
if len(sys.argv) not in [3, 4, 5]:

0 commit comments

Comments
 (0)