From: Vratislav Podzimek vpodzime@redhat.com
These are not so easy to find by pep8 or pylint because they are just strings. --- blivet/blivet.py | 12 ++++++------ blivet/devicefactory.py | 4 ++-- blivet/formats/__init__.py | 2 +- blivet/formats/fs.py | 2 +- blivet/osinstall.py | 2 +- blivet/partitioning.py | 6 +++--- blivet/populator.py | 10 +++++----- 7 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/blivet/blivet.py b/blivet/blivet.py index 09b73bb..710da61 100644 --- a/blivet/blivet.py +++ b/blivet/blivet.py @@ -963,7 +963,7 @@ def new_lv(self, *args, **kwargs): raise ValueError("name already in use")
if thin_pool or thin_volume: - cache_req = kwargs.pop("cacheRequest", None) + cache_req = kwargs.pop("cache_request", None) if cache_req: raise ValueError("Creating cached thin volumes and pools is not supported")
@@ -1001,7 +1001,7 @@ def new_btrfs(self, *args, **kwargs): contain the volume you want to contain the subvolume.
""" - log.debug("newBTRFS: args = %s ; kwargs = %s", args, kwargs) + log.debug("new_btrfs: args = %s ; kwargs = %s", args, kwargs) name = kwargs.pop("name", None) if args: name = args[0] @@ -1021,9 +1021,9 @@ def new_btrfs(self, *args, **kwargs): name = self.suggest_device_name(mountpoint=mountpoint) fmt_args["mountopts"] = "subvol=%s" % name fmt_args["subvolspec"] = name - kwargs.pop("metaDataLevel", None) - kwargs.pop("dataLevel", None) - kwargs.pop("createOptions", None) + kwargs.pop("metadata_level", None) + kwargs.pop("data_level", None) + kwargs.pop("create_options", None) else: dev_class = BTRFSVolumeDevice # set up the volume label, using hostname if necessary @@ -1666,7 +1666,7 @@ def factory_device(self, device_type, size, **kwargs):
# we can't do anything with existing devices # if device and device.exists: - # log.info("factoryDevice refusing to change device %s", device) + # log.info("factory_device refusing to change device %s", device) # return
if not kwargs.get("fstype"): diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py index 1f7a2ad..7a209af 100644 --- a/blivet/devicefactory.py +++ b/blivet/devicefactory.py @@ -1762,8 +1762,8 @@ def _get_child_factory_kwargs(self):
def _get_new_device(self, *args, **kwargs): """ Create and return the factory device as a StorageDevice. """ - kwargs["dataLevel"] = self.container_raid_level - kwargs["metaDataLevel"] = self.container_raid_level + kwargs["data_level"] = self.container_raid_level + kwargs["metadata_level"] = self.container_raid_level kwargs["subvol"] = True return self.storage.new_btrfs(*args, **kwargs)
diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py index af6c828..2d96f09 100644 --- a/blivet/formats/__init__.py +++ b/blivet/formats/__init__.py @@ -96,7 +96,7 @@ def get_format(fmt_type, *args, **kwargs): # this should add/set an instance attribute fmt._name = fmt_type
- log.debug("getFormat('%s') returning %s instance with object id %d", + log.debug("get_format('%s') returning %s instance with object id %d", fmt_type, fmt.__class__.__name__, fmt.id) return fmt
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py index 2b8b657..f69ac90 100644 --- a/blivet/formats/fs.py +++ b/blivet/formats/fs.py @@ -172,7 +172,7 @@ def desc(self): def dict(self): d = super(FS, self).dict d.update({"mountpoint": self.mountpoint, "size": self._size, - "label": self.label, "targetSize": self.target_size, + "label": self.label, "target_size": self.target_size, "mountable": self.mountable}) return d
diff --git a/blivet/osinstall.py b/blivet/osinstall.py index fbbec4d..86f6ba9 100644 --- a/blivet/osinstall.py +++ b/blivet/osinstall.py @@ -457,7 +457,7 @@ def _parse_one_line(self, devspec, mountpoint, fstype, options, _dump="0", _pass # the device's format we found matches what's in the fstab ftype = getattr(fmt, "mount_type", fmt.type) dtype = getattr(device.format, "mount_type", device.format.type) - if hasattr(fmt, "testMount") and fstype != "auto" and ftype != dtype: + if hasattr(fmt, "test_mount") and fstype != "auto" and ftype != dtype: log.info("fstab says %s at %s is %s", dtype, mountpoint, ftype) if fmt.test_mount(): # pylint: disable=no-member device.format = fmt diff --git a/blivet/partitioning.py b/blivet/partitioning.py index bf79928..c5c1a20 100644 --- a/blivet/partitioning.py +++ b/blivet/partitioning.py @@ -206,7 +206,7 @@ def get_best_free_space_region(disk, part_type, req_size, start=None, :type alignment: :class:`parted.Alignment`
""" - log.debug("getBestFreeSpaceRegion: disk=%s part_type=%d req_size=%s " + log.debug("get_best_free_space_region: disk=%s part_type=%d req_size=%s " "boot=%s best=%s grow=%s start=%s", disk.device.path, part_type, req_size, boot, best_free, grow, start) @@ -650,7 +650,7 @@ def allocate_partitions(storage, disks, partitions, freespace): The :class:`~.devices.PartitionDevice` instances will have their name and parents attributes set once they have been allocated. """ - log.debug("allocatePartitions: disks=%s ; partitions=%s", + log.debug("allocate_partitions: disks=%s ; partitions=%s", [d.name for d in disks], ["%s(id %d)" % (p.name, p.id) for p in partitions])
@@ -1729,7 +1729,7 @@ def grow_partitions(disks, partitions, free, size_sets=None): :type size_sets: list of :class:`TotalSizeSet` or :class:`SameSizeSet` :returns: :const:`None` """ - log.debug("growPartitions: disks=%s, partitions=%s", + log.debug("grow_partitions: disks=%s, partitions=%s", [d.name for d in disks], ["%s(id %d)" % (p.name, p.id) for p in partitions]) all_growable = [p for p in partitions if p.req_grow] diff --git a/blivet/populator.py b/blivet/populator.py index 53dd045..7d28a10 100644 --- a/blivet/populator.py +++ b/blivet/populator.py @@ -1402,7 +1402,7 @@ def handle_udev_device_format(self, info, device): # mdraid try: # ID_FS_UUID contains the array UUID - kwargs["mdUuid"] = udev.device_get_uuid(info) + kwargs["md_uuid"] = udev.device_get_uuid(info) except KeyError: log.warning("mdraid member %s has no md uuid", name)
@@ -1416,15 +1416,15 @@ def handle_udev_device_format(self, info, device): pv_info = self.devicetree.pv_info.get(device.path, None) if pv_info: if pv_info.vg_name: - kwargs["vgName"] = pv_info.vg_name + kwargs["vg_name"] = pv_info.vg_name else: log.warning("PV %s has no vg_name", name) if pv_info.vg_uuid: - kwargs["vgUuid"] = pv_info.vg_uuid + kwargs["vg_uuid"] = pv_info.vg_uuid else: log.warning("PV %s has no vg_uuid", name) if pv_info.pe_start: - kwargs["peStart"] = Size(pv_info.pe_start) + kwargs["pe_start"] = Size(pv_info.pe_start) else: log.warning("PV %s has no pe_start", name) elif format_type == "vfat": @@ -1449,7 +1449,7 @@ def handle_udev_device_format(self, info, device): # the format's uuid attr will contain the UUID_SUB, while the # overarching volume UUID will be stored as vol_uuid kwargs["uuid"] = info["ID_FS_UUID_SUB"] - kwargs["volUUID"] = uuid + kwargs["vol_uuid"] = uuid elif format_type == "multipath_member": # blkid does not care that the UUID it sees on a multipath member is # for the multipath set's (and not the member's) formatting, so we
anaconda-patches@lists.fedorahosted.org