[PATCH rhel6-branch] Increment MD container child counter even if its volumes are ignored (#1120640)
by Artur Paszkiewicz
Volumes which are not selected in Specialized Storage Devices are
ignored in addUdevDevice. This causes that their parent container
won't have its child counter incremented, which can later cause an
incorrect unusedRaidMembersWarning.
Resolves: rhbz#1120640
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz(a)intel.com>
---
storage/devicetree.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 4045cdf..b9ea399 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1328,6 +1328,13 @@ class DeviceTree(object):
# slice off the "/dev/" part, lvm filter cares only about the rest
partitions_paths = [p[5:] for p in partitions_paths]
map(lvm.lvm_cc_addFilterRejectRegexp, partitions_paths)
+
+ if udev_device_get_md_container(info):
+ parentName = devicePathToName(udev_device_get_md_container(info))
+ container = self.getDeviceByName(parentName)
+ if container:
+ container.addChild()
+
return
log.debug("scanning %s (%s)..." % (name, sysfs_path))
--
1.8.4.5
8 years, 3 months
[f21-branch][PATCH] clean up stage1 volume check, check format as well as mountpoint
by Adam Williamson
This is a follow-on from e2d10a04. To reduce the change from
the previous behaviour and minimize the chance of any strange
corner-case breakage, this sorts the disk list, rather than
filtering it.
It also now checks the format_type constraint as well as the
mountpoint constraint. There are platforms (PPC) which use a
volume as the stage1 target, but don't require it to be mounted;
this handles those as well as platforms which require the target
volume to be mounted to a specific location.
It's also slightly re-arranged to flow better with the existing
check that filters out protected, hidden and unusable disks.
The overall behaviour change can be described as: on platforms
which require the stage1 target to be a volume, use the first
enumerated disk which contains a potentially valid volume as
the 'boot disk' if the user does not explicitly specify one,
rather than just using the first enumerated disk and failing
if it does not contain a valid stage1 target volume (#1168118).
This also debug logs the result of the 'disks with potential
stage1 targets' check.
---
pyanaconda/kickstart.py | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index d44b349..4aa4fd8 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -379,22 +379,30 @@ class Bootloader(commands.bootloader.F21_Bootloader):
if self.timeout is not None:
storage.bootloader.timeout = self.timeout
- # try to reduce the set of possible 'boot disks' to the disks containing
- # a valid stage1 mount point, if there are any, because those disks
- # should be searched for a stage1_valid device
- disks = storage.disks
- if platform.bootStage1ConstraintDict["mountpoints"]:
- disks = [p.disk for p in storage.devices if getattr(p.format, "mountpoint", None) in platform.bootStage1ConstraintDict["mountpoints"]]
- if not disks:
- # but if not, just go ahead and use the set of all disks or
- # else we'll error out later
- disks = storage.disks
-
# Throw out drives specified that don't exist or cannot be used (iSCSI
# device on an s390 machine)
- disk_names = [d.name for d in disks
- if not d.format.hidden and not d.protected and
- (not blivet.arch.isS390() or not isinstance(d, blivet.devices.iScsiDiskDevice))]
+ disks = [d for d in storage.disks
+ if not d.format.hidden and not d.protected and
+ (not blivet.arch.isS390() or not isinstance(d, blivet.devices.iScsiDiskDevice))]
+ if platform.bootStage1ConstraintDict["format_types"]:
+ # sort the list of disks with those that contain possibly-valid
+ # stage1 partitions first, so we'll pick a disk with one as
+ # bootDrive if it has not been explicitly set: RHBZ #1168118
+ s1vols = [vol for vol in storage.devices if
+ getattr(vol.format, "type", None) in
+ platform.bootStage1ConstraintDict["format_types"]]
+ if platform.bootStage1ConstraintDict["mountpoints"]:
+ # further sort by volumes with valid mount points, if
+ # the platform requires this
+ s1disks = [vol.disk for vol in s1vols if
+ getattr(vol.format, "mountpoint", None) in
+ platform.bootStage1ConstraintDict["mountpoints"]]
+ else:
+ s1disks = [vol.disk for vol in s1vols]
+ log.debug("Disks with potentially valid stage1 volumes: %s",
+ ' '.join([d.name for d in s1disks]))
+ disks.sort(key=lambda x: x in s1disks, reverse=True)
+ disk_names = [d.name for d in disks]
diskSet = set(disk_names)
for drive in self.driveorder[:]:
--
2.1.0
9 years, 1 month
[master] Strip lvm WARNING: lines from output (#1157864)
by Brian C. Lane
LVM has started including a pile of WARNING: lines in its output. These
need to be removed before the return value lvm() is used.
---
blivet/devicelibs/lvm.py | 41 ++++++++++++++++++++++++++---------------
1 file changed, 26 insertions(+), 15 deletions(-)
diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
index 09a4956..c521248 100644
--- a/blivet/devicelibs/lvm.py
+++ b/blivet/devicelibs/lvm.py
@@ -216,13 +216,22 @@ def is_valid_thin_pool_chunk_size(size, discard=False):
else:
return (size % LVM_THINP_MIN_CHUNK_SIZE == 0)
+def strip_lvm_warnings(buf):
+ """ Strip out lines starting with WARNING:
+
+ :param str buf: A string returned from lvm
+ :returns: A list of strings
+ :rtype: list
+ """
+ return [l for l in buf.splitlines() if l and not l.strip().startswith("WARNING:")]
+
def lvm(args, capture=False, ignore_errors=False):
""" Runs lvm with specified arguments.
:param bool capture: if True, return the output of the command.
:param bool ignore_errors: if True, do not raise LVMError on failure
- :returns: the output of the command or None
- :rtype: str or NoneType
+ :returns: list of strings from the output of the command or None
+ :rtype: list or NoneType
:raises: LVMError if command fails
"""
argv = ["lvm"] + args + _getConfigArgs(args)
@@ -230,7 +239,7 @@ def lvm(args, capture=False, ignore_errors=False):
if ret and not ignore_errors:
raise LVMError("running "+ " ".join(argv) + " failed")
if capture:
- return out
+ return strip_lvm_warnings(out)
def pvcreate(device):
# we force dataalignment=1024k since we cannot get lvm to tell us what
@@ -324,9 +333,9 @@ def pvinfo(device=None):
if device:
args.append(device)
- buf = lvm(args, capture=True, ignore_errors=True)
+ lines = lvm(args, capture=True, ignore_errors=True)
pvs = {}
- for line in buf.splitlines():
+ for line in lines:
info = parse_lvm_vars(line)
if len(info.keys()) != 11:
log.warning("ignoring pvs output line: %s", line)
@@ -421,8 +430,12 @@ def vginfo(vg_name):
"-o", "uuid,size,free,extent_size,extent_count,free_count,pv_count",
vg_name]
- buf = lvm(args, capture=True, ignore_errors=True)
- info = parse_lvm_vars(buf)
+ lines = lvm(args, capture=True, ignore_errors=True)
+ try:
+ info = parse_lvm_vars(lines[0])
+ except IndexError:
+ info = {}
+
if len(info.keys()) != 7:
raise LVMError(_("vginfo failed for %s") % vg_name)
@@ -444,9 +457,9 @@ def lvs(vg_name=None):
if vg_name:
args.append(vg_name)
- buf = lvm(args, capture=True, ignore_errors=True)
+ lines = lvm(args, capture=True, ignore_errors=True)
logvols = {}
- for line in buf.splitlines():
+ for line in lines:
info = parse_lvm_vars(line)
if len(info.keys()) != 6:
log.debug("ignoring lvs output line: %s", line)
@@ -461,10 +474,9 @@ def lvorigin(vg_name, lv_name):
args = ["lvs", "--noheadings", "-o", "origin"] + \
["%s/%s" % (vg_name, lv_name)]
- buf = lvm(args, capture=True, ignore_errors=True)
-
+ lines = lvm(args, capture=True, ignore_errors=True)
try:
- origin = buf.splitlines()[0].strip()
+ origin = lines[0].strip()
except IndexError:
origin = ''
@@ -608,10 +620,9 @@ def thinlvpoolname(vg_name, lv_name):
args = ["lvs", "--noheadings", "-o", "pool_lv"] + \
["%s/%s" % (vg_name, lv_name)]
- buf = lvm(args, capture=True, ignore_errors=True)
-
+ lines = lvm(args, capture=True, ignore_errors=True)
try:
- pool = buf.splitlines()[0].strip()
+ pool = lines[0].strip()
except IndexError:
pool = ''
--
1.9.3
9 years, 2 months
RFC: [PATCH] Add --includepkg argument
by Colin Walters
Sending this patch for discussion.
Recently, Fedora has been trying to do a 3 product split. As part of
that, lorax was changed to do "installpkg lorax-product-*" via
provides.
I think that approach is awkward; a much simpler approach is to simply
specify the product package as input to lorax on the command line, via
external rel-eng scripts.
This patch therefore adds --includepkg (and we should probably add an
option to remove the implicit lorax-product-* glob).
---
src/pylorax/__init__.py | 2 ++
src/pylorax/treebuilder.py | 5 +++++
src/sbin/lorax | 4 ++++
3 files changed, 11 insertions(+)
9 years, 4 months
[master/rhel7/f21] Start vncconfig for cutNpaste
by Mark Hamzy
Another reason to start vncconfig in a vnc session is to support cut & paste.
---
pyanaconda/vnc.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
index a7e2072..a9ba148 100644
--- a/pyanaconda/vnc.py
+++ b/pyanaconda/vnc.py
@@ -177,6 +177,21 @@ class VncServer:
maxTries), maxTries)
return False
+ def startVncConfig(self):
+ """Attempt to start vncconfig"""
+
+ self.log.info(_("Attempting to start vncconfig"))
+
+ vncconfigcommand = [self.root+"/usr/bin/vncconfig", "-display", ":%s"%self.display]
+
+ try:
+ vncconfigp = subprocess.Popen(vncconfigcommand, stdout=self.openlogfile(), stderr=subprocess.STDOUT)
+
+ return True
+ except OSError:
+ self.log.info(_("Could not start vncconfig: %s", e))
+ return False
+
def VNCListen(self):
"""Put the server in listening mode.
@@ -247,6 +262,7 @@ class VncServer:
sys.exit(1)
# Lets try to configure the vnc server to whatever the user specified
+ connected = False
if self.vncconnecthost != "":
connected = self.connectToView()
if not connected:
@@ -256,6 +272,9 @@ class VncServer:
os.environ["DISPLAY"]=":%s" % self.display
+ if not connected:
+ self.startVncConfig()
+
def changeVNCPasswdWindow(self):
""" Change the password to a sane parameter.
--
2.1.0
9 years, 4 months
[f21-branch][blivet] Beware of partitions' order when adding partitions
by Vratislav Podzimek
The two blivet patches fix bug when cancelling actions in reversed order causes
partitions getting wrong numbers resulting in various issues. The pyparted patch
is required to make this all work.
Vratislav Podzimek (2):
Return device's children sorted by name
Update partitions' numbers and names when adding new partition
blivet/devicetree.py | 11 ++++++++++-
blivet/formats/disklabel.py | 26 ++++++++++++++++++++++++--
python-blivet.spec | 2 +-
3 files changed, 35 insertions(+), 4 deletions(-)
--
1.9.3
9 years, 4 months
[blivet:master 00/11] A bunch of small changes and a new set of tests
by Anne Mulhern
I'ld like to add these tests to repo now, so that I have some regressions
I can use to check my ongoing development in separate branch.
The rest of the changes are things that allow a quick fix. The basic
idea is that if they are fixed, the tests won't have to be written to
accomodate these little bugs, and that will make things simpler later.
Most are pretty obvious, but
* Check resizable...
* Change "Aggregate..."
* Set NTFS._formattable...,
* Add another check...
were judgement calls and probably need a closer look.
Set NTFS._formattable... is significant, because if _formattable is false
it is not possible to create an NTFS filesystem.
The simple tests have a bunch of FIXME's and CHECKME's in them.
FIXME's are things I'm pretty confident are wrong, but that are kind of
hard to fix. CHECKME's are things I'm not super sure about, but that
look dubious.
mulhern (11):
Make default exists value a boolean in DeviceFormat.__init__.
Check resizable when assigning a new target size.
Simplify _getSize() and currentSize().
Split informaton from infofs program for size on whitespace.
Change "Aggregate block size:" to "Physical block size:" for JFS.
Make an early exit if self._existingSizeFields is []
Simplify FS.free().
Set NTFS._formattable to True.
Add another check for resizable in FS.doResize()
Get rid of long() related code.
Add a bunch of simple tests for filesystem formats.
blivet/formats/__init__.py | 2 +-
blivet/formats/fs.py | 46 +++---
tests/formats_test/fs_test.py | 105 +++++++++++++
tests/formats_test/fstesting.py | 334 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 462 insertions(+), 25 deletions(-)
create mode 100755 tests/formats_test/fs_test.py
create mode 100644 tests/formats_test/fstesting.py
--
1.9.3
9 years, 4 months
[f21-branch][PATCH] Search for a valid stage1 device on disks with stage1 mount points (#1168118)
by Vratislav Podzimek
From: Adam Williamson <awilliam(a)redhat.com>
Otherwise we try the first disk which may not contain a valid stage1 device and
then give up (because the first disk is used to boot from, right?).
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/kickstart.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 72d77f3..d44b349 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -379,9 +379,20 @@ class Bootloader(commands.bootloader.F21_Bootloader):
if self.timeout is not None:
storage.bootloader.timeout = self.timeout
+ # try to reduce the set of possible 'boot disks' to the disks containing
+ # a valid stage1 mount point, if there are any, because those disks
+ # should be searched for a stage1_valid device
+ disks = storage.disks
+ if platform.bootStage1ConstraintDict["mountpoints"]:
+ disks = [p.disk for p in storage.devices if getattr(p.format, "mountpoint", None) in platform.bootStage1ConstraintDict["mountpoints"]]
+ if not disks:
+ # but if not, just go ahead and use the set of all disks or
+ # else we'll error out later
+ disks = storage.disks
+
# Throw out drives specified that don't exist or cannot be used (iSCSI
# device on an s390 machine)
- disk_names = [d.name for d in storage.disks
+ disk_names = [d.name for d in disks
if not d.format.hidden and not d.protected and
(not blivet.arch.isS390() or not isinstance(d, blivet.devices.iScsiDiskDevice))]
diskSet = set(disk_names)
--
1.9.3
9 years, 4 months
[anaconda][rhel7-branch][v2][PATCH] Add help content subpackage
by Martin Kolman
changes from v1:
* now uses the %setup macro for help tarball unpacking
- in the end the switch was much easier than anticipated :)
* use subshell when switching directory
* make the gui subpackage depend on exact version of the help subpackage
* removed debugging detritus
Martin Kolman (1):
Add help content subpackage (#1072033)
anaconda.spec.in | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
--
1.9.3
9 years, 4 months