diff options
author | Cole Robinson <crobinso@redhat.com> | 2013-04-12 08:26:21 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2013-04-13 13:40:29 -0400 |
commit | ae471007fc108cd10fb50808e2bea55822ce5dbe (patch) | |
tree | 9bbb65d1f2b0a668d4cd5ea9c778c3fcfe7fe292 /virtconv | |
parent | d323fbbe23b6ac63543b376c89fb2b0812088682 (diff) | |
download | virt-manager-ae471007fc108cd10fb50808e2bea55822ce5dbe.tar.gz |
Tons of misc pylint fixes
Diffstat (limited to 'virtconv')
-rw-r--r-- | virtconv/diskcfg.py | 8 | ||||
-rw-r--r-- | virtconv/formats.py | 4 | ||||
-rw-r--r-- | virtconv/netdevcfg.py | 4 | ||||
-rw-r--r-- | virtconv/parsers/ovf.py | 68 | ||||
-rw-r--r-- | virtconv/parsers/virtimage.py | 6 | ||||
-rw-r--r-- | virtconv/parsers/vmx.py | 4 |
6 files changed, 47 insertions, 47 deletions
diff --git a/virtconv/diskcfg.py b/virtconv/diskcfg.py index e52e3234..48557e8e 100644 --- a/virtconv/diskcfg.py +++ b/virtconv/diskcfg.py @@ -117,12 +117,12 @@ def run_vdiskadm(args): class disk(object): """Definition of an individual disk instance.""" - def __init__(self, path=None, format=DISK_FORMAT_NONE, bus="ide", - type=DISK_TYPE_DISK): + def __init__(self, path=None, fmt=DISK_FORMAT_NONE, bus="ide", + typ=DISK_TYPE_DISK): self.path = path - self.format = format + self.format = fmt self.bus = bus - self.type = type + self.type = typ self.clean = [] self.csum_dict = {} diff --git a/virtconv/formats.py b/virtconv/formats.py index 059696c6..2199b9ce 100644 --- a/virtconv/formats.py +++ b/virtconv/formats.py @@ -101,7 +101,7 @@ def output_formats(): """ return [p.name for p in _parsers if p.can_export] -def find_input(path, format=None): +def find_input(path, fmt=None): """ Search for a configuration file automatically. If @format is given, then only search using a matching format parser. @@ -113,7 +113,7 @@ def find_input(path, format=None): for p in _parsers: if not p.can_identify: continue - if format and format != p.name: + if fmt and fmt != p.name: continue if os.path.isfile(path): diff --git a/virtconv/netdevcfg.py b/virtconv/netdevcfg.py index b0c5c0b7..a19415c0 100644 --- a/virtconv/netdevcfg.py +++ b/virtconv/netdevcfg.py @@ -26,7 +26,7 @@ NETDEV_TYPE_NETWORK = 3 class netdev(object): """Definition of an individual network device.""" - def __init__(self, mac="auto", type=NETDEV_TYPE_UNKNOWN, + def __init__(self, mac="auto", typ=NETDEV_TYPE_UNKNOWN, source=None, driver=None): """ @mac: either a MAC address, or "auto" @@ -35,6 +35,6 @@ class netdev(object): @driver: device emulated for VM (e.g. vmxnet) """ self.mac = mac - self.type = type + self.type = typ self.source = source self.driver = driver diff --git a/virtconv/parsers/ovf.py b/virtconv/parsers/ovf.py index 86ea9ca1..d00ba45d 100644 --- a/virtconv/parsers/ovf.py +++ b/virtconv/parsers/ovf.py @@ -29,38 +29,38 @@ import logging # Mapping of ResourceType value to device type # http://konkretcmpi.org/cim218/CIM_ResourceAllocationSettingData.html -""" - "Other" [1] - "Computer System" [2] - "Processor" [3] - "Memory" [4] - "IDE Controller" [5] - "Parallel SCSI HBA" [6] - "FC HBA" [7] - "iSCSI HBA" [8] - "IB HCA" [9] - "Ethernet Adapter" [10] - "Other Network Adapter" [11] - "I/O Slot" [12] - "I/O Device" [13] - "Floppy Drive" [14] - "CD Drive" [15] - "DVD drive" [16] - "Disk Drive" [17] - "Tape Drive" [18] - "Storage Extent" [19] - "Other storage device" [20] - "Serial port" [21] - "Parallel port" [22] - "USB Controller" [23] - "Graphics controller" [24] - "IEEE 1394 Controller" [25] - "Partitionable Unit" [26] - "Base Partitionable Unit" [27] - "Power" [28] - "Cooling Capacity" [29] - "Ethernet Switch Port" [30] -""" +# +# "Other" [1] +# "Computer System" [2] +# "Processor" [3] +# "Memory" [4] +# "IDE Controller" [5] +# "Parallel SCSI HBA" [6] +# "FC HBA" [7] +# "iSCSI HBA" [8] +# "IB HCA" [9] +# "Ethernet Adapter" [10] +# "Other Network Adapter" [11] +# "I/O Slot" [12] +# "I/O Device" [13] +# "Floppy Drive" [14] +# "CD Drive" [15] +# "DVD drive" [16] +# "Disk Drive" [17] +# "Tape Drive" [18] +# "Storage Extent" [19] +# "Other storage device" [20] +# "Serial port" [21] +# "Parallel port" [22] +# "USB Controller" [23] +# "Graphics controller" [24] +# "IEEE 1394 Controller" [25] +# "Partitionable Unit" [26] +# "Base Partitionable Unit" [27] +# "Power" [28] +# "Cooling Capacity" [29] +# "Ethernet Switch Port" [30] + DEVICE_CPU = "3" DEVICE_MEMORY = "4" @@ -243,8 +243,8 @@ def _parse_hw_section(vm, nodes, file_refs, disk_section): path = file_refs[ref] - disk = diskcfg.disk(path=path, format=fmt, bus=bus, - type=diskcfg.DISK_TYPE_DISK) + disk = diskcfg.disk(path=path, fmt=fmt, bus=bus, + typ=diskcfg.DISK_TYPE_DISK) vm.disks[(bus, dev_num)] = disk diff --git a/virtconv/parsers/virtimage.py b/virtconv/parsers/virtimage.py index e594e886..47606d1e 100644 --- a/virtconv/parsers/virtimage.py +++ b/virtconv/parsers/virtimage.py @@ -257,7 +257,7 @@ class virtimage_parser(formats.parser): devid = (bus, nr_disk) vm.disks[devid] = diskcfg.disk(bus=bus, - type=diskcfg.DISK_TYPE_DISK) + typ=diskcfg.DISK_TYPE_DISK) vm.disks[devid].format = fmt vm.disks[devid].path = disk.file nr_disk = nr_disk + 1 @@ -265,10 +265,10 @@ class virtimage_parser(formats.parser): nics = domain.interface nic_idx = 0 while nic_idx in range(0, nics): + # XXX Eventually need to add support for mac addresses if given vm.netdevs[nic_idx] = netdevcfg.netdev( - type=netdevcfg.NETDEV_TYPE_UNKNOWN) + typ=netdevcfg.NETDEV_TYPE_UNKNOWN) nic_idx = nic_idx + 1 - """ Eventually need to add support for mac addresses if given""" vm.validate() return vm diff --git a/virtconv/parsers/vmx.py b/virtconv/parsers/vmx.py index ff43ceb5..5f6c9373 100644 --- a/virtconv/parsers/vmx.py +++ b/virtconv/parsers/vmx.py @@ -195,7 +195,7 @@ def parse_netdev_entry(vm, fullkey, value): return if not vm.netdevs.get(inst): - vm.netdevs[inst] = netdevcfg.netdev(type=netdevcfg.NETDEV_TYPE_UNKNOWN) + vm.netdevs[inst] = netdevcfg.netdev(typ=netdevcfg.NETDEV_TYPE_UNKNOWN) # "vlance", "vmxnet", "e1000" if key == "virtualdev": @@ -235,7 +235,7 @@ def parse_disk_entry(vm, fullkey, value): devid = (bus, inst) if not vm.disks.get(devid): vm.disks[devid] = diskcfg.disk(bus=bus, - type=diskcfg.DISK_TYPE_DISK) + typ=diskcfg.DISK_TYPE_DISK) disk = vm.disks[devid] if key == "devicetype": |