[PATCH] Check whether a payload has an instclass (#1185588)
by David Shea
The instclass is set when the payload is setup, so don't crash on
unsetup payloads.
---
pyanaconda/ui/gui/spokes/software.py | 2 +-
pyanaconda/ui/tui/spokes/software.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 2721ef9..5006e4c 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -280,7 +280,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
# If no environment is selected, use the default from the instclass.
# If nothing is set in the instclass, the first environment will be
# selected below.
- if not self.environment:
+ if not self.environment and self.payload.instclass:
self.environment = self.payload.instclass.defaultPackageEnvironment
firstEnvironment = True
diff --git a/pyanaconda/ui/tui/spokes/software.py b/pyanaconda/ui/tui/spokes/software.py
index 0c375c9..7657648 100644
--- a/pyanaconda/ui/tui/spokes/software.py
+++ b/pyanaconda/ui/tui/spokes/software.py
@@ -75,7 +75,7 @@ class SoftwareSpoke(NormalTUISpoke):
environments = self.payload.environments
instclass = self.payload.instclass
- if instclass.defaultPackageEnvironment and \
+ if instclass and instclass.defaultPackageEnvironment and \
instclass.defaultPackageEnvironment in environments:
self._selection = environments.index(instclass.defaultPackageEnvironment)
else:
--
2.1.0
9 years, 3 months
[PATCH] initramfs regeneration, again
by David Shea
Turns out some people really do want to reuse /boot. Fine. Do the thing with
the rpm database instead.
I think there were some cases discussed in IRC that this wouldn't cover, but I
think they involved what to do if someone reused a /boot that contained the
same kernel versions as were being installed, and I don't really care a whole
lot what such a person ends up with.
David Shea (1):
Use the rpm database to find packages installed by package payloads
pyanaconda/packaging/__init__.py | 19 +++++++++++++++++++
pyanaconda/packaging/dnfpayload.py | 7 -------
pyanaconda/packaging/yumpayload.py | 8 --------
3 files changed, 19 insertions(+), 15 deletions(-)
--
2.1.0
9 years, 3 months
[blivet][rhel7][PATCH] More fixes for alignment-related partition allocation failures.
by David Lehman
Commit dcfd06a7cdb7b9 caused an UnboundLocalError, which this fixes.
Also, handle alignment-related failures when no growable requests are
being allocated.
Related: rhbz#1167292
---
blivet/partitioning.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index f33d78d..3f0f15d 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -1122,6 +1122,7 @@ def allocatePartitions(storage, disks, partitions, freespace):
continue
+ temp_part = None
try:
temp_part = addPartition(disklabel,
_free,
@@ -1164,7 +1165,8 @@ def allocatePartitions(storage, disks, partitions, freespace):
sectorsToSize(disk_growth,
disk_sector_size))
- disklabel.partedDisk.removePartition(temp_part)
+ if temp_part:
+ disklabel.partedDisk.removePartition(temp_part)
_part.partedPartition = None
_part.disk = None
@@ -1230,8 +1232,12 @@ def allocatePartitions(storage, disks, partitions, freespace):
raise PartitioningError(_("not enough free space after "
"creating extended partition"))
- partition = addPartition(disklabel, free, part_type, _part.req_size,
- _part.req_start_sector, _part.req_end_sector)
+ try:
+ partition = addPartition(disklabel, free, part_type, _part.req_size,
+ _part.req_start_sector, _part.req_end_sector)
+ except ArithmeticError:
+ raise PartitioningError(_("failed to allocate aligned partition"))
+
log.debug("created partition %s of %s and added it to %s",
partition.getDeviceNodeName(),
Size(partition.getLength(unit="B")),
--
1.9.3
9 years, 3 months
[blivet][master] Use list comprehension instead of filter+lambda in makebumpver
by Vratislav Podzimek
From: Anne Mulhern <amulhern(a)redhat.com>
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
scripts/makebumpver | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/scripts/makebumpver b/scripts/makebumpver
index 07ce065..40ad7ee 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -239,10 +239,8 @@ class MakeBumpVer:
x.find('Merge branch') != 41,
proc[0].strip('\n').split('\n'))
- if self.ignore and self.ignore != '':
- startswith_commit = lambda x: not x.startswith(commit)
- for commit in self.ignore.split(','):
- lines = filter(startswith_commit, lines)
+ ignore_commits = self.ignore.split(',')
+ lines = [l for l in lines if not any(l.startswith(c) for c in ignore_commits)]
rpm_log = []
bad_bump = False
--
2.1.0
9 years, 3 months
[anaconda][rhel7][PATCH] Show empty VGs in the custom spoke.
by David Lehman
Related: rhbz#1167292
---
pyanaconda/ui/gui/spokes/custom.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index b2e6d11..eb34b9a 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -936,7 +936,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
def unusedDevices(self):
unused_devices = [d for d in self.__storage.unusedDevices
if d.disks and d.mediaPresent and
- not d.partitioned and d.direct]
+ not d.partitioned and (d.direct or d.isleaf)]
# add incomplete VGs and MDs
incomplete = [d for d in self.__storage.devicetree._devices
if not getattr(d, "complete", True)]
--
1.9.3
9 years, 3 months
[blivet][master] Get rid of the has_lvm function
by Vratislav Podzimek
It's only used in the tests and since blivet requires lvm tools to be installed
I doubt any (user) code uses it.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
blivet/devicelibs/lvm.py | 8 --------
tests/devicelibs_test/lvm_test.py | 9 ---------
2 files changed, 17 deletions(-)
diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
index 7e2dbef..290e64d 100644
--- a/blivet/devicelibs/lvm.py
+++ b/blivet/devicelibs/lvm.py
@@ -50,14 +50,6 @@ ThPoolProfile = namedtuple("ThPoolProfile", ["name", "desc"])
KNOWN_THPOOL_PROFILES = (ThPoolProfile("thin-generic", N_("Generic")),
ThPoolProfile("thin-performance", N_("Performance")))
-def has_lvm():
- if util.find_program_in_path("lvm"):
- for line in open("/proc/devices").readlines():
- if "device-mapper" in line.split():
- return True
-
- return False
-
# Start config_args handling code
#
# Theoretically we can handle all that can be handled with the LVM --config
diff --git a/tests/devicelibs_test/lvm_test.py b/tests/devicelibs_test/lvm_test.py
index 8f776b2..d88c451 100755
--- a/tests/devicelibs_test/lvm_test.py
+++ b/tests/devicelibs_test/lvm_test.py
@@ -254,15 +254,6 @@ class LVMAsRootTestCase(LVMAsRootTestCaseBase):
self.assertEqual(lvm.lvs(vg_name="wrong-vg-name"), {})
##
- ## has_lvm
- ##
- # pass
- self.assertEqual(lvm.has_lvm(), True)
-
- # fail
- # TODO
-
- ##
## lvremove
##
# pass
--
2.1.0
9 years, 3 months
[anaconda][master][v2][PATCH] Replace urlgrabber usage by python-requests
by Martin Kolman
Changes from v1:
* pass stream=True, to requests so that the file is not downloaded to memory first (oops!)
* call flush() on the file object so that it does not swamp the cache too much
* log the start and end of the image download operation
Martin Kolman (1):
Replace python-urlgrabber with python-requests (#1141242)
anaconda.spec.in | 5 ++-
pyanaconda/kickstart.py | 13 ++++---
pyanaconda/packaging/__init__.py | 36 ++++++++++----------
pyanaconda/packaging/livepayload.py | 67 ++++++++++++++++++++-----------------
4 files changed, 65 insertions(+), 56 deletions(-)
--
2.1.0
9 years, 3 months
[blivet][master] pylint-inspired fixes
by Vratislav Podzimek
These things were reported by pylint when I tried to clean everything up before
starting to port blivet to libblockdev. One issue still remains:
************* Module blivet/formats/fs.py
blivet/formats/fs.py:1499: [W0201(attribute-defined-outside-init), NoDevFS._setDevice] Attribute '_device' defined outside __init__
but I don't want to create a conflict with mulhern's patches for the NoDevFS class.
Vratislav Podzimek (3):
Disable pylint check for cached LVM data in more places
Define the _device attribute in constructor
Do not create lambda over and over in a cycle
blivet/devicetree.py | 4 ++--
blivet/formats/fs.py | 4 ++++
scripts/makebumpver | 3 ++-
3 files changed, 8 insertions(+), 3 deletions(-)
--
2.1.0
9 years, 3 months
[PATCH 1/2] Double quote when printing error results from a kickstart test.
by Chris Lumens
I made life hard on myself and put asterisks in the output, so I need to
double quote everything here to prevent a file listing on the host from
getting printed out.
---
tests/kickstart_tests/basic-ostree.sh | 2 +-
tests/kickstart_tests/groups-and-envs-1.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/kickstart_tests/basic-ostree.sh b/tests/kickstart_tests/basic-ostree.sh
index b6fab5b..0416f4f 100755
--- a/tests/kickstart_tests/basic-ostree.sh
+++ b/tests/kickstart_tests/basic-ostree.sh
@@ -55,7 +55,7 @@ validate() {
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != "SUCCESS" ]]; then
status=1
- echo ${result}
+ echo "${result}"
fi
return ${status}
diff --git a/tests/kickstart_tests/groups-and-envs-1.sh b/tests/kickstart_tests/groups-and-envs-1.sh
index ebbc9f7..e8fef0a 100755
--- a/tests/kickstart_tests/groups-and-envs-1.sh
+++ b/tests/kickstart_tests/groups-and-envs-1.sh
@@ -48,7 +48,7 @@ validate() {
echo '*** /root/RESULT does not exist in VM image.'
elif [[ "${result}" != "SUCCESS" ]]; then
status=1
- echo ${result}
+ echo "${result}"
fi
return ${status}
--
2.2.1
9 years, 3 months
[blivet][master] drop useless entries from formatByDefault exceptlist
by Adam Williamson
These will never match, as the 'exceptlist' is only used to
except devices whose mountpoint starts with one of the
'formatlist' entries, and / is not in 'formatlist'.
---
blivet/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index 88809fb..691e45c 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -1369,7 +1369,7 @@ class Blivet(object):
def formatByDefault(self, device):
"""Return whether the device should be reformatted by default."""
formatlist = ['/boot', '/var', '/tmp', '/usr']
- exceptlist = ['/home', '/usr/local', '/opt', '/var/www']
+ exceptlist = ['/usr/local', '/var/www']
if not device.format.linuxNative:
return False
--
2.2.1
9 years, 3 months