Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the getattr calls with PEP8 property/attribute names #277

Merged
merged 1 commit into from
Nov 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion blivet/autopart.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def _schedule_partitions(storage, disks, implicit_devices, min_luks_entropy=0, r
continue
elif request.fstype == "biosboot":
is_gpt = (stage1_device and
getattr(stage1_device.format, "labelType", None) == "gpt")
getattr(stage1_device.format, "label_type", None) == "gpt")
has_bios_boot = (stage1_device and
any([p.format.type == "biosboot"
for p in storage.partitions
Expand Down
2 changes: 1 addition & 1 deletion blivet/blivet.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def unused_devices(self):
used_devices.extend(new.ancestors)

for device in self.partitions:
if getattr(device, "isLogical", False):
if getattr(device, "is_logical", False):
extended = device.disk.format.extended_partition.path
used_devices.append(self.devicetree.get_device_by_path(extended))

Expand Down
4 changes: 2 additions & 2 deletions blivet/devicefactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def get_container(self, device=None, name=None, allow_existing=False):
if allow_existing or not c.exists]
if containers:
# XXX All containers should have a "free" attribute
containers.sort(key=lambda c: getattr(c, "freeSpace", c.size),
containers.sort(key=lambda c: getattr(c, "free_space", c.size),
reverse=True)
container = containers[0]

Expand Down Expand Up @@ -1449,7 +1449,7 @@ def _get_device_size(self):
@property
def _pesize(self):
""" The extent size of our vg or the default if we have no vg. """
return getattr(self.container, "peSize", lvm.LVM_PE_SIZE)
return getattr(self.container, "pe_size", lvm.LVM_PE_SIZE)

def _get_device_space(self):
""" Calculate and return the total disk space needed for the device.
Expand Down
6 changes: 3 additions & 3 deletions blivet/osinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ def _parse_one_line(self, devspec, mountpoint, fstype, options, _dump="0", _pass

# make sure, if we're using a device from the tree, that
# the device's format we found matches what's in the fstab
ftype = getattr(fmt, "mountType", fmt.type)
dtype = getattr(device.format, "mountType", device.format.type)
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:
log.info("fstab says %s at %s is %s", dtype, mountpoint, ftype)
if fmt.test_mount(): # pylint: disable=no-member
Expand Down Expand Up @@ -829,7 +829,7 @@ def fstab(self):
if isinstance(device, OpticalDevice):
continue

fstype = getattr(device.format, "mountType", device.format.type)
fstype = getattr(device.format, "mount_type", device.format.type)
if fstype == "swap":
mountpoint = "swap"
options = device.format.options
Expand Down
8 changes: 4 additions & 4 deletions blivet/populator.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ def __init__(self, devicetree=None, conf=None, passphrase=None,
# indicates whether or not the tree has been fully populated
self.populated = False

self.exclusive_disks = getattr(conf, "exclusiveDisks", [])
self.ignored_disks = getattr(conf, "ignoredDisks", [])
self.exclusive_disks = getattr(conf, "exclusive_disks", [])
self.ignored_disks = getattr(conf, "ignored_disks", [])
self.iscsi = iscsi
self.dasd = dasd

self.disk_images = {}
images = getattr(conf, "diskImages", {})
images = getattr(conf, "disk_images", {})
if images:
# this will overwrite self.exclusive_disks
self.set_disk_images(images)

# protected device specs as provided by the user
self.protected_dev_specs = getattr(conf, "protectedDevSpecs", [])
self.protected_dev_specs = getattr(conf, "protected_dev_specs", [])
self.live_backing_device = None

# names of protected devices at the time of tree population
Expand Down