Skip to content

Commit

Permalink
Merge branch '3.4-devel' into 3.5-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechtrefny committed Sep 30, 2021
2 parents aa9d8b9 + d0b4c2c commit 3146758
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 37 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PYTHON?=python3
PKG_INSTALL?=dnf

L10N_REPOSITORY=git@github.com:storaged-project/blivet-weblate.git
L10N_BRANCH=master

PKGNAME=blivet
SPECFILE=python-blivet.spec
Expand Down Expand Up @@ -36,7 +37,7 @@ potfile:
# - commit pot file
# - tell user to verify this file and push to the remote from the temp dir
TEMP_DIR=$$(mktemp --tmpdir -d $(PKGNAME)-localization-XXXXXXXXXX) || exit 1 ; \
git clone --depth 1 -b master -- $(L10N_REPOSITORY) $$TEMP_DIR || exit 2 ; \
git clone --depth 1 -b $(L10N_BRANCH) -- $(L10N_REPOSITORY) $$TEMP_DIR || exit 2 ; \
cp po/$(PKGNAME).pot $$TEMP_DIR/ || exit 3 ; \
pushd $$TEMP_DIR ; \
git difftool --trust-exit-code -y -x "diff -u -I '^\"POT-Creation-Date: .*$$'" HEAD ./$(PKGNAME).pot &>/dev/null ; \
Expand All @@ -50,7 +51,7 @@ potfile:
git commit -m "Update $(PKGNAME).pot" && \
popd && \
git submodule foreach git checkout -- blivet.pot ; \
echo "Pot file updated for the localization repository $(L10N_REPOSITORY)" && \
echo "Pot file updated for the localization repository $(L10N_REPOSITORY) branch $(L10N_BRANCH)" && \
echo "Please confirm and push:" && \
echo "$$TEMP_DIR" ; \
fi ;
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Blivet is available in Fedora repositories. You can install it using

# dnf install python3-blivet

#### Daily builds (for Fedora)
#### Daily builds for Fedora

Daily builds of Blivet are available in `@storage/blivet-daily` Copr repository.
You can enable it using
Expand All @@ -25,11 +25,15 @@ You can enable it using

Daily builds of _libblockdev_ and _libbytesize_ are also in this repo.

#### OBS repository (for Ubuntu and Debian)
#### OBS repository for Ubuntu and Debian

Packages for Debian (testing and unstable) and Ubuntu (19.04 and newer) are available through the Open Build Service.
Instructions for adding the repository are available [here](https://software.opensuse.org/download.html?project=home:vtrefny&package=python3-blivet).

#### Copr repository for openSUSE, Mageia and OpenMandriva

Packages for openSUSE Tumbleweed, Mageia (8 and newer) and OpenMandriva (Cooker and Rolling) are available in our [blivet-stable Copr repository](https://copr.fedorainfracloud.org/coprs/g/storage/blivet-stable/).

#### PyPI

Blivet is also available through the [Python Package Index](https://pypi.org/project/blivet/).
Expand Down
2 changes: 1 addition & 1 deletion blivet/devices/btrfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def list_subvolumes(self, snapshots_only=False):
else:
self._get_default_subvolume_id()

except errors.FSError as e:
except errors.FSError:
pass

return subvols
Expand Down
4 changes: 2 additions & 2 deletions blivet/formats/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ def _create(self, **kwargs):
label=not self.relabels(),
set_uuid=self.can_set_uuid(),
nodiscard=self.can_nodiscard())
except FSWriteLabelError as e:
except FSWriteLabelError:
log.warning("Choosing not to apply label (%s) during creation of filesystem %s. Label format is unacceptable for this filesystem.", self.label, self.type)
except FSWriteUUIDError as e:
except FSWriteUUIDError:
log.warning("Choosing not to apply UUID (%s) during"
" creation of filesystem %s. UUID format"
" is unacceptable for this filesystem.",
Expand Down
2 changes: 1 addition & 1 deletion blivet/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _get_translations():
# In Python 2, return the translated strings as unicode objects.
# yes, pylint, the lambdas are necessary, because I want _get_translations()
# evaluated on every call.
# pylint: disable=unnecessary-lambda
# pylint: disable=unnecessary-lambda,redundant-u-string-prefix
if six.PY2:
_ = lambda x: _get_translations().ugettext(x) if x != "" else u""
P_ = lambda x, y, z: _get_translations().ungettext(x, y, z)
Expand Down
2 changes: 1 addition & 1 deletion blivet/partitioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ def allocate_partitions(storage, disks, partitions, freespace, boot_disk=None):
req_size,
_part.req_start_sector,
_part.req_end_sector)
except ArithmeticError as e:
except ArithmeticError:
log.debug("failed to allocate aligned partition "
"for growth test")
continue
Expand Down
28 changes: 17 additions & 11 deletions blivet/tasks/availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,26 +247,29 @@ def availability_errors(self, resource):
return []


class UnavailableMethod(Method):
class _UnavailableMethod(Method):

""" Method that indicates a resource is unavailable. """

def __init__(self, error_msg=None):
self.error_msg = error_msg or "always unavailable"

def availability_errors(self, resource):
return ["always unavailable"]
return [self.error_msg]


UnavailableMethod = UnavailableMethod()
UnavailableMethod = _UnavailableMethod()


class AvailableMethod(Method):
class _AvailableMethod(Method):

""" Method that indicates a resource is available. """

def availability_errors(self, resource):
return []


AvailableMethod = AvailableMethod()
AvailableMethod = _AvailableMethod()


def application(name):
Expand Down Expand Up @@ -372,12 +375,15 @@ def available_resource(name):
blockdev.LVMTechMode.MODIFY)})
BLOCKDEV_LVM_TECH = BlockDevMethod(BLOCKDEV_LVM)

BLOCKDEV_LVM_VDO = BlockDevTechInfo(plugin_name="lvm",
check_fn=blockdev.lvm_is_tech_avail,
technologies={blockdev.LVMTech.VDO: (blockdev.LVMTechMode.CREATE |
blockdev.LVMTechMode.REMOVE |
blockdev.LVMTechMode.QUERY)})
BLOCKDEV_LVM_TECH_VDO = BlockDevMethod(BLOCKDEV_LVM_VDO)
if hasattr(blockdev.LVMTech, "VDO"):
BLOCKDEV_LVM_VDO = BlockDevTechInfo(plugin_name="lvm",
check_fn=blockdev.lvm_is_tech_avail,
technologies={blockdev.LVMTech.VDO: (blockdev.LVMTechMode.CREATE |
blockdev.LVMTechMode.REMOVE |
blockdev.LVMTechMode.QUERY)})
BLOCKDEV_LVM_TECH_VDO = BlockDevMethod(BLOCKDEV_LVM_VDO)
else:
BLOCKDEV_LVM_TECH_VDO = _UnavailableMethod(error_msg="Installed version of libblockdev doesn't support LVM VDO technology")

# libblockdev mdraid plugin required technologies and modes
BLOCKDEV_MD_ALL_MODES = (blockdev.MDTechMode.CREATE |
Expand Down
3 changes: 1 addition & 2 deletions blivet/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ def get_cow_sysfs_path(dev_path, dev_sysfsPath):

cow_path = dev_path + "-cow"
if not os.path.islink(cow_path):
raise RuntimeError("get_cow_sysfs_path: Could not find cow device for" %
(dev_path))
raise RuntimeError("get_cow_sysfs_path: Could not find cow device for %s" % dev_path)

# dev path for cow devices is actually a link to a dm device (e.g. /dev/dm-X)
# we need the 'dm-X' name for sysfs_path (e.g. /sys/devices/virtual/block/dm-X)
Expand Down
24 changes: 12 additions & 12 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
master_doc = 'index'

# General information about the project.
project = u'Blivet'
copyright = u'2013-2016, Red Hat, Inc.' # pylint: disable=redefined-builtin
project = 'Blivet'
copyright = '2013-2016, Red Hat, Inc.' # pylint: disable=redefined-builtin

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -186,8 +186,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Blivet.tex', u'Blivet Documentation',
u'David Lehman', 'manual'),
('index', 'Blivet.tex', 'Blivet Documentation',
'David Lehman', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -216,8 +216,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'blivet', u'Blivet Documentation',
[u'David Lehman'], 1)
('index', 'blivet', 'Blivet Documentation',
['David Lehman'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -230,8 +230,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Blivet', u'Blivet Documentation',
u'David Lehman', 'Blivet', 'One line description of project.',
('index', 'Blivet', 'Blivet Documentation',
'David Lehman', 'Blivet', 'One line description of project.',
'Miscellaneous'),
]

Expand All @@ -248,10 +248,10 @@
# -- Options for Epub output ---------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = u'Blivet'
epub_author = u'David Lehman'
epub_publisher = u'David Lehman'
epub_copyright = u'2013, David Lehman'
epub_title = 'Blivet'
epub_author = 'David Lehman'
epub_publisher = 'David Lehman'
epub_copyright = '2013, David Lehman'

# The language of the text. It defaults to the language option
# or en if the language is not set.
Expand Down
2 changes: 0 additions & 2 deletions tests/devices_test/device_properties_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ def state_check(self, device, **kwargs):
if k in kwargs:
test_func = kwargs[k]
if test_func is None:
import pdb
pdb.set_trace()
getattr(device, k)
else:
test_func(device, k)
Expand Down
1 change: 1 addition & 0 deletions tests/pylint/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ disable=W0105, # String statement has no effect
W0614, # Unused import %s from wildcard import
I0011, # Locally disabling %s
W0707, # Consider explicitly re-raising using the 'from' keyword
W1514, # Using open without explicitly specifying an encoding
C,
R

Expand Down
2 changes: 1 addition & 1 deletion tests/pylint/runpylint.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self):
FalsePositive(r"No value for argument 'member_count' in unbound method call$"),
FalsePositive(r"No value for argument 'smallest_member_size' in unbound method call$"),
FalsePositive(r"Parameters differ from overridden 'do_task' method$"),
FalsePositive(r"Bad option value '(subprocess-popen-preexec-fn|try-except-raise|environment-modify|arguments-renamed)'"),
FalsePositive(r"Bad option value '(subprocess-popen-preexec-fn|try-except-raise|environment-modify|arguments-renamed|redundant-u-string-prefix)'"),
FalsePositive(r"Instance of '(Action.*Device|Action.*Format|Action.*Member|Device|DeviceAction|DeviceFormat|Event|ObjectID|PartitionDevice|StorageDevice|BTRFS.*Device|LoopDevice)' has no 'id' member$"),
FalsePositive(r"Instance of 'GError' has no 'message' member") # overriding currently broken local pylint disable
]
Expand Down

0 comments on commit 3146758

Please sign in to comment.