[rhel6-branch 1/2] Add logging to bootloaderInfo (#974996)
by Brian C. Lane
import was missing, it is only used in a couple of error paths.
Resolves: rhbz#974996
---
booty/bootloaderInfo.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index eb6bee6..5d76733 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -40,6 +40,9 @@ import booty
import checkbootloader
from util import getDiskPart
+import logging
+log = logging.getLogger("anaconda")
+
if not iutil.isS390():
import block
--
1.9.3
9 years, 11 months
[blivet] Update _name directly when tearing down loop devices (#1104558)
by David Shea
Resetting the name of loop devices needs to bypass the existing device
check.
---
blivet/devices.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/devices.py b/blivet/devices.py
index cdd0642..7f38ebd 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -4250,7 +4250,7 @@ class LoopDevice(StorageDevice):
def _postTeardown(self, recursive=False):
StorageDevice._postTeardown(self, recursive=recursive)
- self.name = "tmploop%d" % self.id
+ self._name = "tmploop%d" % self.id
self.sysfsPath = ''
@property
--
1.9.0
9 years, 11 months
[PATCH] Revert "Refresh after checkbox clicked (#1074188)"
by David Shea
This reverts commit 2e994d5a9594c2df7ca4de8aeef6c25d76d6876b.
This, along with the change already on master in
e1ef7140d029c561bdc8a16b4b5589d27e172bc3, fixes the problem of being
unable to select disks in the advanced storage filter spoke. The change
was reverted on rhel7-branch but left behind on master.
---
pyanaconda/ui/gui/spokes/filter.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/filter.py b/pyanaconda/ui/gui/spokes/filter.py
index 20b5a50..f323bcd 100644
--- a/pyanaconda/ui/gui/spokes/filter.py
+++ b/pyanaconda/ui/gui/spokes/filter.py
@@ -545,7 +545,7 @@ class FilterSpoke(NormalSpoke):
elif not self._store[itr][1] and self._store[itr][3] in self.selected_disks:
self.selected_disks.remove(self._store[itr][3])
- self.refresh()
+ self._update_summary()
def on_add_iscsi_clicked(self, widget, *args):
dialog = ISCSIDialog(self.data, self.storage)
--
1.9.0
9 years, 11 months
[blivet] Fix device name validation for devices that can contain / (#1103751) (v2)
by David Shea
In addition to FileDevice and its subclasses, allow / in name for
NFSDevice, BTRFSSubVolumeDevice, and any StorageDevice trying to create
a name starting with 'cciss/'.
---
blivet/devices.py | 16 ++++++++++++++++
tests/devices_test.py | 4 ++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/blivet/devices.py b/blivet/devices.py
index cdd0642..fbfa095 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -1120,6 +1120,13 @@ class StorageDevice(Device):
def isNameValid(cls, name):
# This device corresponds to a file in /dev, so no /'s or nulls,
# and the name cannot be . or ..
+
+ # ...except some names *do* contain directory components, for this
+ # is an imperfect world of joy and sorrow mingled. For cciss, split
+ # the path into its components and do the real check on each piece
+ if name.startswith("cciss/"):
+ return all(cls.isNameValid(n) for n in name.split('/'))
+
badchars = any(c in ('\x00', '/') for c in name)
return not(badchars or name == '.' or name == '..')
@@ -4609,6 +4616,10 @@ class NFSDevice(StorageDevice, NetworkStorageDevice):
""" Destroy the device. """
log_method_call(self, self.name, status=self.status)
+ @classmethod
+ def isNameValid(cls, name):
+ # Override StorageDevice.isNameValid to allow /
+ return not('\x00' in name or name == '.' or name == '..')
class BTRFSDevice(StorageDevice):
""" Base class for BTRFS volume and sub-volume devices. """
@@ -4965,3 +4976,8 @@ class BTRFSSubVolumeDevice(BTRFSDevice):
data.subvol = True
data.name = self.name
data.preexist = self.exists
+
+ @classmethod
+ def isNameValid(cls, name):
+ # Override StorageDevice.isNameValid to allow /
+ return not('\x00' in name or name == '.' or name == '..')
diff --git a/tests/devices_test.py b/tests/devices_test.py
index 6598eba..faefde0 100644
--- a/tests/devices_test.py
+++ b/tests/devices_test.py
@@ -508,8 +508,8 @@ class DeviceNameTestCase(unittest.TestCase):
def testStorageDefvice(self):
# Check that / and NUL are rejected along with . and ..
- good_names = ['sda1', '1sda', 'good-name']
- bad_names = ['sda/1', 'sda\x00', '.', '..']
+ good_names = ['sda1', '1sda', 'good-name', 'cciss/c0d0']
+ bad_names = ['sda/1', 'sda\x00', '.', '..', 'cciss/..']
for name in good_names:
self.assertTrue(StorageDevice.isNameValid(name))
--
1.9.0
9 years, 11 months
[master][PATCH] If we cannot activate keyboard, at least populate the missing items (#1104541)
by Vratislav Podzimek
When activating keyboard configuration, we populate missing keyboard
configuration items. However, on image/directory installations, we cannot
activate keyboard configuration, but many components of our UI rely on the
keyboard configuration items being set.
Also update the docstring of the populate_missing_items method which has become
slightly nicer with the commit 57837c4298b0e4436246c6a0606fe5a1a3c48a71.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
anaconda | 8 ++++++--
pyanaconda/keyboard.py | 10 +++++++---
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/anaconda b/anaconda
index 9c14933..fb191c0 100755
--- a/anaconda
+++ b/anaconda
@@ -1017,8 +1017,12 @@ if __name__ == "__main__":
if not ksdata.keyboard.keyboard:
ksdata.keyboard.keyboard = opts.keymap
- if ksdata.keyboard.keyboard and can_touch_runtime_system("activate keyboard"):
- keyboard.activate_keyboard(ksdata.keyboard)
+ if ksdata.keyboard.keyboard:
+ if can_touch_runtime_system("activate keyboard"):
+ keyboard.activate_keyboard(ksdata.keyboard)
+ else:
+ # at least make sure we have all the values
+ keyboard.populate_missing_items(ksdata.keyboard)
# Some post-install parts of anaconda are implemented as kickstart
# scripts. Add those to the ksdata now.
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index c694c57..083f823 100644
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -138,9 +138,9 @@ def normalize_layout_variant(layout_str):
def populate_missing_items(keyboard):
"""
- Function that populates keyboard.vc_keymap and keyboard.x_layouts if
- they are missing. By invoking LocaledWrapper's methods this function
- MODIFIES CONFIGURATION FILES.
+ Function that populates keyboard.vc_keymap and keyboard.x_layouts if they
+ are missing. By invoking LocaledWrapper's methods this function READS AND
+ WRITES CONFIGURATION FILES (but tries to keep their content unchanged).
:type keyboard: ksdata.keyboard object
@@ -148,6 +148,10 @@ def populate_missing_items(keyboard):
localed = LocaledWrapper()
+ if keyboard._keyboard and not (keyboard.vc_keymap or keyboard.x_layouts):
+ # just the value in old format given, use it as a vc_keymap
+ keyboard.vc_keymap = keyboard._keyboard
+
if keyboard.x_layouts and not keyboard.vc_keymap:
keyboard.vc_keymap = localed.convert_layout(keyboard.x_layouts[0])
--
1.9.3
9 years, 11 months
[blivet:master 00/26] RAID patches
by Anne Mulhern
These patches will be vaguely remniscent of the last set of RAID related
patches I sent out, but not all that close.
The changes require an anaconda patch.
The first four are nice and simple.
The very last is only related to RAID because I felt
I had to understand the method in order to understand device populateKSData()
methods, and to understand it I had to think about, so I ended up rewriting it.
mulhern (26):
Import name 'lvm' instead of names from lvm package.
Comment mdraid.mdcreate() and update tests appropriately.
Remove DMRaidArrayDevice.members property.
Extract selection of members in completed() into a separate method.
No longer use _standard_levels as the default set of RAID levels.
Adjust RaidLevel hierarchy so that all raid level objects extend
RAIDLevel
Allow the RAID object itself to be a valid RAID descriptor for lookup.
Move Container class to raid package and tidy it up
Add Linear and Single to the RAID classes.
Add a has_redundancy method that returns True if there is actual
redundancy
Add an is_uniform property to the RAID levels.
Add a Dup class to the various descendants of RAIDLevel.
Make createBitmap() a property and update tests appropriately.
Use has_redundancy raid property when checking whether a device is
removable
Update the mdraid.mdadd comments
Use has_redundancy property to decide how to add a member to an array.
Check for required methods in MDRaidLevels.isRaidLevel.
Remove getRaidLevel() from mdraid file and make RAID_levels public
Add "linear" to mdraid's list of supported raid levels.
Add lists of supported RAID levels for btrfs and lvm
Make BTRFS devices use RAID objects instead of strings for levels
Put get_supported_raid_levels in devicefactory.py
Distribute devicefactory.get_raid_level within devices classes.
Make all devicefactory classes uses RAID objects instead of strings.
Move the code for getting a space requirement from devicefactory to
raid.
Simplify a small chunk of Blivet.updateKSData()
blivet/__init__.py | 12 +-
blivet/devicefactory.py | 137 ++++++++++------
blivet/devicelibs/btrfs.py | 10 +-
blivet/devicelibs/lvm.py | 3 +
blivet/devicelibs/mdraid.py | 64 +++-----
blivet/devicelibs/raid.py | 297 +++++++++++++++++++++++++----------
blivet/devices.py | 186 +++++++++++++++++-----
tests/devicefactory_test.py | 26 +--
tests/devicelibs_test/mdraid_test.py | 21 +--
tests/devicelibs_test/raid_test.py | 73 ++++-----
tests/devices_test.py | 58 +++++--
tests/devicetree_test.py | 2 +-
12 files changed, 590 insertions(+), 299 deletions(-)
--
1.8.3.1
9 years, 11 months
Fix the way categories are handled (take 03, I think)
by Samantha N. Bueno
Taking clumens' suggestion, I've gotten rid of the separately managed
categories for TUI and GUI and consolidated everything.
Patches are pretty self explanatory:
01: gets rid of separate cat files, moves everything to
pyanaconda.ui.categories
02: updates all of the spokes and other UI files with new category path
03: adds a small change to collectCategoriesAndSpokes
04: updates all config/make/po files
I can't identify that any changes are necessary for initial-setup, but
Martin, please let me know if I am mistaken.
Samantha
9 years, 11 months
[blivet:master] RAID patches addendum 1 (v2)
by Anne Mulhern
Uses raw_device property in a few more places than previous, otherwise,
the same.
mulhern (1):
Make a StorageDevice.raw_device property and use it where appropriate
blivet/devicefactory.py | 27 ++++++---------------------
blivet/devices.py | 9 +++++++++
tests/devices_test.py | 1 +
3 files changed, 16 insertions(+), 21 deletions(-)
--
1.8.3.1
9 years, 11 months
[rhel6-branch] Fix rsyslogd calls to remove deprecated flag. (#1104234)
by Samantha N. Bueno
Rsyslog is being rebased to a version which no longer supports -c, so
just remove it. We're not doing anything special anyway.
Resolve: rhbz#1104234
---
loader/init.c | 2 +-
loader/linuxrc.s390 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/loader/init.c b/loader/init.c
index 7c5bcc8..53b7a15 100644
--- a/loader/init.c
+++ b/loader/init.c
@@ -172,7 +172,7 @@ static void startSyslog(void) {
klogctl(8, NULL, 1);
/* now we really start the daemon. */
int status;
- status = system("/sbin/rsyslogd -c 4");
+ status = system("/sbin/rsyslogd");
if (status < 0 ||
!WIFEXITED(status) ||
WEXITSTATUS(status) != 0) {
diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index 95e9499..94ba4c0 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -339,7 +339,7 @@ function init_main() {
# start rsyslogd after mount of /tmp ramfs since it logs to /tmp/syslog
echo $"Starting rsyslogd..."
- rsyslogd -c 4
+ rsyslogd
ifconfig lo 127.0.0.1 netmask 255.0.0.0
route add -host 127.0.0.1 dev lo
--
1.8.3.1
9 years, 11 months
[blivet:master] RAID patches addendum 2
by Anne Mulhern
Trivial.
mulhern (1):
Add a getRaidLevel() convenience method to raid.py
blivet/devicefactory.py | 4 ++--
blivet/devicelibs/raid.py | 14 ++++++++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
--
1.8.3.1
9 years, 11 months