Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 8fdc026

Browse files
committed
Clean up some misc pylint
1 parent a5f1212 commit 8fdc026

8 files changed

Lines changed: 51 additions & 10 deletions

File tree

tests/xmlconfig-xml/boot-usb2.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<domain type='xen'>
2+
<name>TestGuest</name>
3+
<uuid>12345678-1234-1234-1234-123456789012</uuid>
4+
<memory>409600</memory>
5+
<currentMemory>204800</currentMemory>
6+
<vcpu>5</vcpu>
7+
<os>
8+
<type arch='i686'>hvm</type>
9+
<loader>/usr/lib/xen/boot/hvmloader</loader>
10+
<boot dev='network'/>
11+
</os>
12+
<features>
13+
<acpi/><apic/>
14+
</features>
15+
<clock offset="utc"/>
16+
<on_poweroff>destroy</on_poweroff>
17+
<on_reboot>restart</on_reboot>
18+
<on_crash>restart</on_crash>
19+
<devices>
20+
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
21+
<controller type='usb' index='0' model='ich9-ehci1'/>
22+
<controller type='usb' index='0' model='ich9-uhci1'>
23+
<master startport='0'/>
24+
</controller>
25+
<controller type='usb' index='0' model='ich9-uhci2'>
26+
<master startport='2'/>
27+
</controller>
28+
<controller type='usb' index='0' model='ich9-uhci3'>
29+
<master startport='4'/>
30+
</controller>
31+
<input type='mouse' bus='ps2'/>
32+
<graphics type='sdl' display=':3.4' xauth='/tmp/.Xauthority'/>
33+
<console type='pty'/>
34+
</devices>
35+
</domain>

tests/xmlconfig.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,13 @@ def testCpuset(self):
848848
cpu = virtinst.CPU(g.conn)
849849
self.assertEquals(cpu.vcpus_from_topology(), 1)
850850

851+
def testUsb2(self):
852+
i = utils.make_pxe_installer()
853+
g = utils.get_basic_fullyvirt_guest(installer=i)
854+
855+
g.add_usb_ich9_controllers()
856+
857+
self._compare(g, "boot-usb2", False)
851858

852859
#
853860
# Full Install tests: try to mimic virt-install as much as possible

virt-convert

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def main():
213213
clean += [ options.output_dir ]
214214
except OSError, e:
215215
if (e.errno != errno.EEXIST):
216-
fail("Could not create directory %s: %s",
216+
fail("Could not create directory %s: %s",
217217
(options.output_dir, e.strerror))
218218

219219
if not options.output_file:

virtinst/DistroInstaller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def set_location(self, val):
231231
conn=self.conn,
232232
volName=stuple)
233233
val = d.path
234-
except Exception, e:
234+
except:
235235
_util.log_exception("Error validating install location")
236236
raise ValueError(_("Checking installer location failed: "
237237
"Could not find media '%s'." % str(val)))

virtinst/Guest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from VirtualDisk import VirtualDisk
4141
from VirtualInputDevice import VirtualInputDevice
4242
from VirtualCharDevice import VirtualCharDevice
43+
from VirtualController import VirtualControllerUSB
4344
from Clock import Clock
4445
from Seclabel import Seclabel
4546
from CPU import CPU

virtinst/User.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ def has_priv(self, priv, conn=None):
5555
return (self._euid == 0) or _util.is_qemu_system(conn)
5656

5757
if platform.system() == 'SunOS':
58-
return self._sun_has_priv(priv, conn)
58+
return self._sun_has_priv(priv)
5959

6060
# For all others, just assume that prescence of a connection
6161
# means we are privileged enough
6262
return True
6363

64-
def _sun_has_priv(self, priv, conn=None):
64+
def _sun_has_priv(self, priv):
6565
# Not easy to work out!
6666
if self._euid != User.current().euid:
6767
return self._euid == 0

virtinst/VirtualFilesystem.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ def _get_target(self):
141141
def _set_target(self, val):
142142
is_qemu = self.is_qemu()
143143

144-
# In case of qemu for default fs type (mount) target is not
144+
# In case of qemu for default fs type (mount) target is not
145145
# actually a directory, it is merely a arbitrary string tag
146146
# that is exported to the guest as a hint for where to mount
147147
if (is_qemu and
148148
(self.type == self.TYPE_DEFAULT or
149149
self.type == self.TYPE_MOUNT)):
150-
pass
150+
pass
151151
elif not os.path.isabs(val):
152152
raise ValueError(_("Filesystem target '%s' must be an absolute "
153153
"path") % val)

virtinst/VirtualHostDevice.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
import VirtualDevice
2121
import NodeDeviceParser
2222
import logging
23-
import libvirt
2423

25-
from virtinst import support
2624
from virtinst import _gettext as _
2725
from XMLBuilderDomain import _xml_property
2826

@@ -179,12 +177,12 @@ def _get_source_xml(self):
179177

180178
def setup(self, conn=None):
181179
"""
182-
Perform DeviceDetach and DeviceReset calls if necessary
180+
Unused
183181
184182
@param conn: libvirt virConnect instance to use (defaults to devices
185183
connection)
186184
"""
187-
raise NotImplementedError
185+
ignore = conn
188186

189187
def _get_xml_config(self):
190188
xml = (" <hostdev mode='%s' type='%s' managed='%s'>\n" % \

0 commit comments

Comments
 (0)