[blivet:master 0/9] A bunch of miscellaneous pylint patches
by Anne Mulhern
Just a bunch of small, reasonably self-contained pylint patches.
mulhern (9):
Remove all references to lvm_vg_blacklist and blacklistVG.
Obvious fix inspired by an "Undefined variable warning"
Remove unnecessary lambda wrappers on assertion functions
Make sure _state_functions is a dictionary in base class
Use self.nic instead of nic
Suppress false positive W0631 error.
Make LabelingAsRoot class an abstract class and define two properties
Add a bunch of E1120 errors to the false positives file
Ignore E1101 errors in savePassphrase.
blivet/__init__.py | 2 --
blivet/devicefactory.py | 2 +-
blivet/devicelibs/lvm.py | 6 ------
blivet/devices.py | 4 ++--
scripts/makebumpver | 1 +
tests/devices_test.py | 6 +++---
tests/formats_test/fslabeling.py | 9 +++++++++
tests/formats_test/labeling_test.py | 30 ++++++++++++++++++------------
tests/pylint/pylint-false-positives | 4 ++++
9 files changed, 38 insertions(+), 26 deletions(-)
--
1.8.3.1
10 years, 1 month
[PATCH master] Fix typo in nm_is_connected method check.
by Radek Vykydal
---
pyanaconda/network.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 2a90bdf..67ea2e9 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -1194,7 +1194,7 @@ def _wait_for_connecting_NM():
"""If NM is in connecting state, wait for connection.
Return value: NM has got connection."""
- if nm.nm_is_connected:
+ if nm.nm_is_connected():
return True
if nm.nm_is_connecting():
--
1.7.11.7
10 years, 1 month
[PATCH] Suppress selinux error log when using default (#1083239)
by Brian C. Lane
When there is no kickstart or no selinux command it will default to
None, meaning use whatever mode was set by the installed packages. There
is no need to log this as an error.
Resolves: rhbz#1083239
---
pyanaconda/kickstart.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 91659a3..b0c104f 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -1367,7 +1367,10 @@ class SELinux(commands.selinux.FC3_SELinux):
SELINUX_ENFORCING: "enforcing",
SELINUX_PERMISSIVE: "permissive" }
- if self.selinux not in selinux_states:
+ if self.selinux is None:
+ # Use the defaults set by the installed (or not) selinux package
+ return
+ elif self.selinux not in selinux_states:
log.error("unknown selinux state: %s", self.selinux)
return
--
1.9.0
10 years, 1 month
[PATCH] Use the AnacondaWidgets python gi-overrides for pylint
by David Shea
---
tests/pylint/pylint-one.sh | 3 +++
tests/testenv.sh | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/tests/pylint/pylint-one.sh b/tests/pylint/pylint-one.sh
index 9759293..abb3824 100755
--- a/tests/pylint/pylint-one.sh
+++ b/tests/pylint/pylint-one.sh
@@ -17,6 +17,9 @@ pylint_output="$(pylint \
--ignored-classes=DefaultInstall,Popen,QueueFactory,TransactionSet \
--defining-attr-methods=__init__,_grabObjects,initialize,reset,start,setUp \
--load-plugins=intl,preconf,markup \
+ --init-hook=\
+'import gi.overrides, os;
+gi.overrides.__path__[0:0] = (os.environ["ANACONDA_WIDGETS_OVERRIDES"].split(":") if "ANACONDA_WIDGETS_OVERRIDES" in os.environ else [])' \
$DISABLED_WARN_OPTIONS \
$DISABLED_ERR_OPTIONS \
$NON_STRICT_OPTIONS "$@" 2>&1 | \
diff --git a/tests/testenv.sh b/tests/testenv.sh
index 9493451..017559d 100644
--- a/tests/testenv.sh
+++ b/tests/testenv.sh
@@ -29,3 +29,7 @@ export LD_LIBRARY_PATH
export PYTHONPATH
export top_srcdir
export top_builddir
+
+# This must be added to gi.overrides.__path__ by any test requiring the
+# AnacondaWidgets gi-overrides
+export ANACONDA_WIDGETS_OVERRIDES="${top_srcdir}/widgets/python"
--
1.9.0
10 years, 1 month
[blivet] Fix some problems with lvm detection.
by David Lehman
Patch 1 fixes a bug introduced by commit fd40c67f03481a that doesn't
manifest in any noticeable way unless you scan a VG with multiple PVs,
which I did not do in my testing.
Patch 2 fixes a bug in commit 7928b2a07fb30d1a3bd that apparently
doesn't have any real consequences unless there are raid or thinp LVs
present. It also fixes a problem that seems like it must have been
caused by a change to the layout of thin pools.
I'm quite sick of this kind of fallout. In February I started working on
high-level tests that involve creating devices on disk images and then
feeding them to devicetree.populate to make sure it ends up seeing things
as they are. I put it on hold to deal with other things after DevConf,
but I am moving it to the top o' the pile as of now.
10 years, 1 month
[blivet:master 0/5] A bunch of pylint inspired import fixes
by Anne Mulhern
All on testing code.
mulhern (5):
Remove wildcard import
Do not use implicit relative imports
Move import to top level.
Import from the defining module.
Remove unused imports.
tests/action_test.py | 7 +---
tests/clearpart_test.py | 2 +-
tests/devicefactory_test.py | 12 +++----
tests/devicelibs_test/btrfs_test.py | 15 ++++----
tests/devicelibs_test/crypto_test.py | 15 ++++----
tests/devicelibs_test/lvm_test.py | 68 +++++++++++++++++++-----------------
tests/devicelibs_test/mdraid_test.py | 17 ++++-----
tests/devicelibs_test/swap_test.py | 17 +++++----
tests/devices_test.py | 15 ++++----
tests/formats_test/fslabeling.py | 19 +++++-----
tests/formats_test/init_test.py | 1 -
tests/formats_test/labeling_test.py | 2 +-
tests/formats_test/selinux_test.py | 3 +-
tests/size_test.py | 3 +-
tests/storagetestcase.py | 8 -----
15 files changed, 95 insertions(+), 109 deletions(-)
--
1.8.3.1
10 years, 1 month
[PATCH] support ppc64le in anaconda redux
by Mark Hamzy
Add support for the ppc64le architecture in anaconda.
Tips for adding a new architecture:
1) Search for instances of getArch()
2) Search for instances of s_arch
3) Search for instances of uname
---
anaconda.spec.in | 6 +++---
configure.ac | 2 +-
pyanaconda/isys/__init__.py | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index bb0db85..f6b3335 100755
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -1,4 +1,4 @@
-%define livearches %{ix86} x86_64 ppc ppc64
+%define livearches %{ix86} x86_64 ppc ppc64 ppc64le
Summary: Graphical system installer
Name: anaconda
@@ -230,9 +230,9 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
%ifarch %livearches
desktop-file-install ---dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/liveinst.desktop
-%else
-%{__rm} -rf %{buildroot}%{_bindir}/liveinst %{buildroot}%{_sbindir}/liveinst
%endif
+# NOTE: If you see "error: Installed (but unpackaged) file(s) found" that include liveinst files,
+# check the IS_LIVEINST_ARCH in configure.ac to make sure your architecture is properly defined
%find_lang %{name}
diff --git a/configure.ac b/configure.ac
index 5260fc8..90bef51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,7 +171,7 @@ AC_CANONICAL_BUILD
s_arch="`echo $build_cpu | sed -e s/i.86/i386/ -e s/powerpc.*/ppc/`"
AM_CONDITIONAL(IS_LIVEINST_ARCH,
- [test x$s_arch = xppc || test x$s_arch = xi386 || test x$s_arch = xx86_64])
+ [test x$s_arch = xppc || test x$s_arch = xppc64 || test x$s_arch = xppc64le || test x$s_arch = xi386 || test x$s_arch = xx86_64])
AC_CONFIG_SUBDIRS([widgets])
diff --git a/pyanaconda/isys/__init__.py b/pyanaconda/isys/__init__.py
index c216428..c985b3e 100644
--- a/pyanaconda/isys/__init__.py
+++ b/pyanaconda/isys/__init__.py
@@ -45,7 +45,7 @@ import datetime
import logging
log = logging.getLogger("anaconda")
-if blivet.arch.getArch() in ("ppc64"):
+if blivet.arch.getArch() in ["ppc64", "ppc64le"]:
MIN_RAM = 768 * 1024
GUI_INSTALL_EXTRA_RAM = 512 * 1024
else:
--
1.9.0
10 years, 1 month
[PATCH6/6] Use for-cycle else: branch instead of extra variable
by Vratislav Podzimek
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/gui/spokes/custom.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 7a2b81a..b2e25a7 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -596,17 +596,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
def _update_all_devices_in_selectors(self):
for s in self._accordion.allSelectors:
- replaced = False
for new_device in self._storage_playground.devices:
if ((s._device.name == new_device.name) or
(getattr(s._device, "req_name", 1) == getattr(new_device, "req_name", 2)) and
s._device.type == new_device.type and
s._device.format.type == new_device.format.type):
selectorFromDevice(new_device, selector=s)
- replaced = True
break
-
- if not replaced:
+ else:
log.warning("failed to replace device: %s", s._device)
def _save_right_side(self, selector):
--
1.9.0
10 years, 1 month
[blivet:master 0/5] Using property and abc.abstractproperty
by Anne Mulhern
These patches are just about using property and abc.abstractproperty with
a little more facility. They mostly just correct the verbosity I was prone
to when properties were still a bit of a novelty to me. The main motivation
is that they are now slightly bad usage examples, so I don't want to be
referring to them when they're in this state. All that patch reviewing jogged
my memory.
Make name an abstract property...should be completely invisible to client code.
Make reads property... make things terser, that's all.
Change _labelstrRegex...makes things terser and changes the name which is
only used when calling testing code, anyway.
Change defaultLabel...ditto.
Change labelApp...the only one of any significance. Touches fs.py but only to
change a name.
mulhern (5):
Make name an abstract property and omit _name
Make reads property a bit more succinct.
Change _labelstrRegex to a more concisely defined abstract property.
Change defaultLabel to a more concisely defined abstract property.
Change labelApp to a more concisely defined abstract property
blivet/formats/fs.py | 18 +++----
blivet/formats/fslabel.py | 96 +++++++++++++------------------------
blivet/formats/fslabeling.py | 88 ++++++++--------------------------
tests/formats_test/fslabeling.py | 4 +-
tests/formats_test/labeling_test.py | 6 +--
5 files changed, 65 insertions(+), 147 deletions(-)
--
1.8.3.1
10 years, 1 month
[PATCH] Display WWIDs in the filter UI for FCoE devices (#1080316).
by Chris Lumens
---
pyanaconda/ui/gui/spokes/filter.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/filter.py b/pyanaconda/ui/gui/spokes/filter.py
index 22e2ee5..92757d6 100644
--- a/pyanaconda/ui/gui/spokes/filter.py
+++ b/pyanaconda/ui/gui/spokes/filter.py
@@ -28,6 +28,7 @@ import itertools
from blivet import arch
from blivet.devices import DASDDevice, FcoeDiskDevice, iScsiDiskDevice, MultipathDevice, MDRaidArrayDevice, ZFCPDiskDevice
from blivet.fcoe import has_fcoe
+from blivet.udev import udev_get_device, udev_device_get_wwid
from pyanaconda.flags import flags
from pyanaconda.i18n import _, N_, P_
@@ -137,6 +138,14 @@ class FilterPage(object):
combo.set_active(0)
def _long_identifier(self, disk):
+ # For FCoE devices that have a serial number, we want to display that as
+ # the WWID. If nothing's found, just default to the link or name below.
+ if isinstance(disk, FcoeDiskDevice):
+ info = udev_get_device(disk.sysfsPath)
+ wwid = udev_device_get_wwid(info)
+ if wwid:
+ return wwid
+
# For iSCSI devices, we want the long ip-address:port-iscsi-tgtname-lun-XX
# identifier, but blivet doesn't expose that in any useful way and I don't
# want to go asking udev. Instead, we dig around in the deviceLinks and
--
1.8.3.1
10 years, 1 month