[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
[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, 3 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
[blivet:master] Factoring out MDRaidArrayDevice functionality
by Anne Mulhern
The question is, do the two subclasses make any kind of sense?
Also, assuming they do, what is the best solution to making sure
that the correct class gets constructed in the correct situation?
Would it be reasonable to go about this by defining __new__() in
MDRaidArrayDevice and using that method to select the appropriate subclass?
The appropriate subclass is decided by
a) RAID level
b) type of parent
mulhern (1):
Factor out MDRaidArrayDevice w/ type in ("mdcontainer",
"mdbiosraidarray")
blivet/devicelibs/mdraid.py | 2 +-
blivet/devices/__init__.py | 2 +-
blivet/devices/container.py | 18 +--
blivet/devices/md.py | 189 +++++++++++++++--------
tests/devicelibs_test/mdraid_interrogate_test.py | 4 +-
tests/devicelibs_test/mdraid_test.py | 1 -
tests/devices_test.py | 16 +-
7 files changed, 141 insertions(+), 91 deletions(-)
--
1.9.3
9 years, 5 months
[blivet:master 0/3] Miscellaneous patches related to use of Size()
by Anne Mulhern
Patches related to how Size objects are used in blivet.
mulhern (3):
Update minSize method headers.
Put size values in Size universe eagerly.
Add a method that determines whether a number is an exact power of 2.
blivet/__init__.py | 2 +-
blivet/deviceaction.py | 3 ++-
blivet/devicefactory.py | 12 ++++++------
blivet/devicelibs/lvm.py | 9 ++++-----
blivet/devicelibs/mdraid.py | 3 ++-
blivet/devicelibs/raid.py | 13 +++++++------
blivet/devices/btrfs.py | 6 +++---
blivet/devices/disk.py | 3 ++-
blivet/devices/lvm.py | 14 +++++---------
blivet/devices/md.py | 4 ++--
blivet/devices/nodev.py | 3 ++-
blivet/devices/partition.py | 12 ++++++------
blivet/devices/storage.py | 4 ++--
blivet/formats/__init__.py | 10 +++++++++-
blivet/formats/disklabel.py | 7 +++----
blivet/formats/fs.py | 18 +++++++-----------
blivet/partitioning.py | 12 ++++++------
blivet/util.py | 28 ++++++++++++++++++++++++++++
tests/devicelibs_test/raid_test.py | 24 ++++++++++++------------
tests/partitioning_test.py | 4 ++--
tests/size_test.py | 4 ++--
tests/util_test.py | 22 ++++++++++++++++++++++
22 files changed, 135 insertions(+), 82 deletions(-)
create mode 100644 tests/util_test.py
--
1.9.3
9 years, 5 months
[PATCH] When locating the EFI bootDevice, ensure that it has a mountpoint (#1145812)
by Anne Mulhern
Resolves: rhbz#1145812
The EFI boot device is not considered valid unless it has a mountpoint,
so it makes no sense to provide one w/out.
This fact also holds for subclasses of EFI, taking into consideration whether
or not isEFI is True.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
platform.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/platform.py b/platform.py
index 51e2e3f..3ff05ab 100644
--- a/platform.py
+++ b/platform.py
@@ -253,7 +253,8 @@ class EFI(Platform):
for part in self.anaconda.id.storage.partitions:
if part.disk and part.disk.name == drive \
and part.format.type == "efi" \
- and self.validBootPartSize(part.size):
+ and self.validBootPartSize(part.size) \
+ and part.format.mountpoint:
return part
return None
--
1.9.3
9 years, 5 months
[initial-setup][rhel7-branch][master][f21-branch][PATCH] Explicitly require the main package in the GUI sub package (#1078917)
by Martin Kolman
Related: rhbz#1078917
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
initial-setup.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/initial-setup.spec b/initial-setup.spec
index 003b0ee..149d0c0 100644
--- a/initial-setup.spec
+++ b/initial-setup.spec
@@ -48,6 +48,7 @@ a series of steps that allows for easier configuration of the machine.
Summary: Graphical user interface for the initial-setup utility
Requires: gtk3
Requires: anaconda-gui >= %{anacondaver}
+Requires: %{name} = %{version}-%{release}
%description gui
The initial-setup-gui package contains a graphical user interface for the
--
1.9.3
9 years, 5 months
[rhel7/master/f21] custom: Clearing errors should also clear Done clicked state (#1158609)
by Brian C. Lane
When there is an error we tell the user to click done again to exit. If
they do anything else the state needs to be cleared. We already call
clear_errors from all these places in order to reset the error bar, so
add clearing of the done clicked state.
Since do_check also clears errors, set the state to True *after* an
error has been found.
Resolves: rhbz#1158609
---
pyanaconda/ui/gui/spokes/custom.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 9daf9d1..a260fc2 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2188,7 +2188,6 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# If back has been clicked on once already and no other changes made on the screen,
# run the storage check now. This handles displaying any errors in the info bar.
if not self._back_already_clicked:
- self._back_already_clicked = True
new_luks = [d for d in self.__storage.devices
if d.format.type == "luks" and not d.format.exists]
@@ -2208,6 +2207,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
luks.format.passphrase = self.passphrase
if not self._do_check():
+ self._back_already_clicked = True
return
if len(self.__storage.devicetree.findActions()) > 0:
@@ -3109,6 +3109,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
def clear_errors(self):
self._error = None
self.clear_info()
+ self._back_already_clicked = False
# This callback is for the button that just resets the UI to anaconda's
# current understanding of the disk layout.
--
1.9.3
9 years, 5 months
[rhel7/master/f21] Catch EOFError in raw_input (#1158841)
by Brian C. Lane
Just in case someone hits ctrl-d in text mode.
Resolves: rhbz#1158841
---
pyanaconda/ui/tui/simpleline/base.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/tui/simpleline/base.py b/pyanaconda/ui/tui/simpleline/base.py
index 8a17e72..7ad8276 100644
--- a/pyanaconda/ui/tui/simpleline/base.py
+++ b/pyanaconda/ui/tui/simpleline/base.py
@@ -158,8 +158,12 @@ class App(object):
return
else:
# lock acquired, we can run raw_input
- data = raw_input()
- RAW_INPUT_LOCK.release()
+ try:
+ data = raw_input()
+ except EOFError:
+ data = ""
+ finally:
+ RAW_INPUT_LOCK.release()
queue.put((hubQ.HUB_CODE_INPUT, [data]))
--
1.9.3
9 years, 5 months