[blivet 0/6] Preliminary work for adding a btrfs.resize method
by Anne Mulhern
These are all cleanup, preparatory to writing and testing a btrfs.resize method.
The first couple are obvious cleanup of some tests that require being run as
root and will run along with the new btrfs tests if called in the usual
way from the makefile, or else they are connected with that in some way.
1) probably unimportant.
2) this method is dead.
3) just a lot of tests that actually execute btrfs commands on an image. Probably innocuous.
4) trivial.
5) trivial.
6) Really just work on the tests.
mulhern (6):
Changes to devicelibs.mdraid.mdactivate.
Remove format.luks.LUKS.removeKeyFromFile.
Add a file to run btrfs tests.
Add a comment to btrfs.create_volume.
Remove some methods from devicelibs.btrfs.
Work on devicelibs.btrfs methods that require that the device be
mounted.
blivet/devicelibs/btrfs.py | 35 +++++--
blivet/devicelibs/mdraid.py | 22 ++--
blivet/formats/luks.py | 17 ----
tests/devicelibs_test/btrfs_test.py | 190 +++++++++++++++++++++++++++++++++++
tests/devicelibs_test/mdraid_test.py | 25 ++---
5 files changed, 241 insertions(+), 48 deletions(-)
create mode 100755 tests/devicelibs_test/btrfs_test.py
--
1.8.3.1
10 years, 5 months
[master] A couple username creation changes
by Samantha N. Bueno
Some small edits to the username regex removing capitalized characters
as a valid match.
Second patch displays an error message in text-mode if a user attempts
to create an invalid username, instead of just shoving the prompt in
their face again.
10 years, 5 months
[lorax] sort glob output before using it
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
share/runtime-postinstall.tmpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/share/runtime-postinstall.tmpl b/share/runtime-postinstall.tmpl
index ec4bbd5..93ea12b 100644
--- a/share/runtime-postinstall.tmpl
+++ b/share/runtime-postinstall.tmpl
@@ -3,7 +3,7 @@
<%page args="root, basearch, libdir, configdir"/>
<%
-PYTHONDIR = glob("usr/"+libdir+"/python?.?")[0]
+PYTHONDIR = sorted(glob("usr/"+libdir+"/python?.?"))[0]
stubs = ("list-harddrives", "raidstart", "raidstop")
configdir = configdir + "/common"
%>
--
1.8.3.1
10 years, 5 months
[PATCH] Skip checks on files that are not staged for commit.
by David Shea
This keeps the pylint hook from complaining about files that aren't
actually being committed.
---
scripts/githooks/pre-commit | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/githooks/pre-commit b/scripts/githooks/pre-commit
index 501a9c3..5704b28 100755
--- a/scripts/githooks/pre-commit
+++ b/scripts/githooks/pre-commit
@@ -39,8 +39,9 @@ pylint_files = []
# The first character is the status in the index (or our side of a merge),
# the second character is the status in the tree (or their side of a merge).
for gf in git_files.splitlines():
- # If the file is being removed or is not in git, ignore it
- if gf[0] in ('D', '?'):
+ # If the file is being removed, or is not in git, or is not part of this
+ # commit, ignore it
+ if gf[0] in ('D', '?', ' '):
continue
# If the file is being renamed, grab the target filename
if gf[0] == 'R':
--
1.8.4.2
10 years, 5 months
[master/rhel7] createUser is already in a chroot (#1038241)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Resolves: rhbz#1038241
---
pyanaconda/users.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/users.py b/pyanaconda/users.py
index d2fbb75..b47e760 100644
--- a/pyanaconda/users.py
+++ b/pyanaconda/users.py
@@ -281,7 +281,7 @@ class Users:
if kwargs.get("homedir", False):
userEnt.set(libuser.HOMEDIRECTORY, kwargs["homedir"])
else:
- iutil.mkdirChain(root+'/home')
+ iutil.mkdirChain('/home')
userEnt.set(libuser.HOMEDIRECTORY, "/home/" + user_name)
if kwargs.get("shell", False):
--
1.8.3.1
10 years, 5 months
[master/rhel7] Fix default device for ks=cdrom (#1042500)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
dracut/kickstart-genrules.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dracut/kickstart-genrules.sh b/dracut/kickstart-genrules.sh
index f29ad87..452d6bc 100755
--- a/dracut/kickstart-genrules.sh
+++ b/dracut/kickstart-genrules.sh
@@ -10,7 +10,10 @@ case "${kickstart%%:*}" in
;;
cdrom|hd|bd) # cdrom, cdrom:<dev>:<path>, hd:<dev>:<path>, bd:<dev>:<path>
splitsep ":" "$kickstart" kstype ksdev kspath
- [ "$kstype" = "cdrom" ] && [ -z "$ksdev" ] && ksdev="/dev/cdrom"
+ if [ "$kstype" = "cdrom" ] && [ -z "$kspath" ]; then
+ kspath="$ksdev"
+ ksdev="/dev/cdrom"
+ fi
ksdev=$(disk_to_dev_path $ksdev)
if [ "$kstype" = "bd" ]; then # TODO FIXME: no biospart support yet
warn "inst.ks='$kickstart'"
--
1.8.3.1
10 years, 5 months
[blivet] Use // division so that it continues to be floor division in Python 3.
by Anne Mulhern
Also added some tests and some comments to the affected methods.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devicelibs/raid.py | 10 ++++++++--
tests/devicelibs_test/raid_test.py | 3 +++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/blivet/devicelibs/raid.py b/blivet/devicelibs/raid.py
index 37f9755..b55804c 100644
--- a/blivet/devicelibs/raid.py
+++ b/blivet/devicelibs/raid.py
@@ -99,6 +99,8 @@ class RAIDLevel(object):
:param member_count: number of members in this array
:param member_count: int
+
+ The return value has the same units as the size parameter.
"""
if member_count < self.min_members:
raise RaidError("%s requires at least %d disks" % (self.name, self.min_members))
@@ -113,11 +115,15 @@ class RAIDLevel(object):
def get_raw_array_size(self, member_count, smallest_member_size):
"""Calculate the raw arraysize, i.e., the number of MB available.
+
:param member_count: the number of members in the array
:param type: int
:param smallest_member_size: the size (MB) of the smallest
member of this array
:param type: int
+
+ The return value has the same units as the smallest_member_size
+ parameter.
"""
if member_count < self.min_members:
raise RaidError("%s requires at least %d disks" % (self.name, self.min_members))
@@ -372,10 +378,10 @@ class RAID10(RAIDLevel):
return member_count - self.min_members
def _get_base_member_size(self, size, member_count):
- return div_up(size, (member_count / 2))
+ return div_up(size, (member_count // 2))
def _get_raw_array_size(self, member_count, smallest_member_size):
- return (member_count / 2) * smallest_member_size
+ return (member_count // 2) * smallest_member_size
def _get_size(self, size, chunk_size):
return size
diff --git a/tests/devicelibs_test/raid_test.py b/tests/devicelibs_test/raid_test.py
index a25672d..84bf94a 100644
--- a/tests/devicelibs_test/raid_test.py
+++ b/tests/devicelibs_test/raid_test.py
@@ -63,6 +63,8 @@ class RaidTestCase(unittest.TestCase):
self.assertEqual(raid.RAID5.get_base_member_size(4,4), 2)
self.assertEqual(raid.RAID6.get_base_member_size(4,4), 2)
self.assertEqual(raid.RAID10.get_base_member_size(4,4), 2)
+ self.assertEqual(raid.RAID10.get_base_member_size(4,5), 2)
+ self.assertEqual(raid.RAID10.get_base_member_size(5,5), 3)
self.assertRaises(errors.RaidError, raid.RAID10.get_base_member_size,
4, 3)
@@ -78,6 +80,7 @@ class RaidTestCase(unittest.TestCase):
self.assertEqual(raid.RAID5.get_raw_array_size(4, 2), 6)
self.assertEqual(raid.RAID6.get_raw_array_size(4, 2), 4)
self.assertEqual(raid.RAID10.get_raw_array_size(4, 2), 4)
+ self.assertEqual(raid.RAID10.get_raw_array_size(5, 2), 4)
##
## get_recommended_stride
--
1.8.3.1
10 years, 5 months
[master] Refresh environment addons on source change (#1033749)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
pyanaconda/ui/gui/spokes/software.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 6c76abc..e46be2f 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -329,6 +329,11 @@ class SoftwareSelectionSpoke(NormalSpoke):
def refreshAddons(self):
self._addonStore.clear()
+
+ # The source was changed, make sure the list is current
+ if not self.txid_valid:
+ self._parseEnvironments()
+
if self.environment and (self.environment in self._environmentAddons):
# We have two lists: One of addons specific to this environment,
# and one of all the others. The environment-specific ones will be displayed
--
1.8.3.1
10 years, 5 months