[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, 2 months
[PATCH] Check parent/container type for thin volumes and normal volumes.
by David Lehman
---
blivet/devices/lvm.py | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index d1817dd..1c72c86 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -440,6 +440,7 @@ class LVMLogicalVolumeDevice(DMDevice):
_type = "lvmlv"
_resizable = True
_packages = ["lvm2"]
+ _containerClass = LVMVolumeGroupDevice
def __init__(self, name, parents=None, size=None, uuid=None,
copies=1, logSize=None, segType=None,
@@ -480,14 +481,17 @@ class LVMLogicalVolumeDevice(DMDevice):
:type percent: int
"""
- if self.__class__.__name__ == "LVMLogicalVolumeDevice":
- if isinstance(parents, list):
- if len(parents) != 1:
- raise ValueError("constructor requires a single LVMVolumeGroupDevice instance")
- elif not isinstance(parents[0], LVMVolumeGroupDevice):
- raise ValueError("constructor requires a LVMVolumeGroupDevice instance")
- elif not isinstance(parents, LVMVolumeGroupDevice):
- raise ValueError("constructor requires a LVMVolumeGroupDevice instance")
+ if isinstance(parents, list):
+ if len(parents) != 1:
+ raise ValueError("constructor requires a single %s instance" % self._containerClass.__name__)
+
+ container = parents[0]
+ else:
+ container = parents
+
+ if not isinstance(container, self._containerClass):
+ raise ValueError("constructor requires a %s instance" % self._containerClass.__name__)
+
DMDevice.__init__(self, name, size=size, fmt=fmt,
sysfsPath=sysfsPath, parents=parents,
exists=exists)
@@ -1093,6 +1097,7 @@ class LVMThinPoolDevice(LVMLogicalVolumeDevice):
class LVMThinLogicalVolumeDevice(LVMLogicalVolumeDevice):
""" An LVM Thin Logical Volume """
_type = "lvmthinlv"
+ _containerClass = LVMThinPoolDevice
@property
def pool(self):
--
1.9.3
9 years, 2 months
[PATCH] Fix pylint complaints about log lines
by Brian C. Lane
---
dracut/parse-kickstart | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index cee151a..412ac6a 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -354,7 +354,7 @@ def ksnet_to_ifcfg(net, filename=None):
return
if (not os.path.isdir("/sys/class/net/%s" % dev)
and not net.bondslaves and not net.teamslaves and not net.bridgeslaves):
- log.info("can't find device %s" % dev)
+ log.info("can't find device %s", dev)
return
ifcfg = dict()
if filename is None:
@@ -442,7 +442,7 @@ def ksnet_to_ifcfg(net, filename=None):
}
add_s390_settings(slave, slave_ifcfg)
slave_filename = "/tmp/ifcfg/ifcfg-%s" % "_".join(slave_ifcfg['NAME'].split(" "))
- log.info("writing ifcfg %s for slave %s of bond %s" % (slave_filename, slave, dev))
+ log.info("writing ifcfg %s for slave %s of bond %s", slave_filename, slave, dev)
write_ifcfg(slave_filename, slave_ifcfg)
if net.teamslaves:
@@ -466,7 +466,7 @@ def ksnet_to_ifcfg(net, filename=None):
slave_ifcfg['TEAM_PORT_CONFIG'] = "'" + cfg + "'"
slave_filename = "/tmp/ifcfg/ifcfg-%s" % "_".join(slave_ifcfg['NAME'].split(" "))
- log.info("writing ifcfg %s for slave %s of team %s" % (slave_filename, slave, dev))
+ log.info("writing ifcfg %s for slave %s of team %s", slave_filename, slave, dev)
write_ifcfg(slave_filename, slave_ifcfg)
if net.bridgeslaves:
@@ -517,7 +517,7 @@ def ksnet_to_ifcfg(net, filename=None):
ifcfg['PHYSDEV'] = dev
filename = "/tmp/ifcfg/ifcfg-%s" % interface_name
- log.info("writing ifcfg %s for %s" % (filename, dev))
+ log.info("writing ifcfg %s for %s", filename, dev)
if write_ifcfg(filename, ifcfg):
return filename
@@ -528,7 +528,7 @@ def write_ifcfg(filename, ifcfg):
for k,v in ifcfg.items():
f.write("%s=%s\n" % (k,v))
except IOError as e:
- log.error("can't write %s: %s" % (filename, e))
+ log.error("can't write %s: %s", filename, e)
return False
return True
--
1.9.3
9 years, 2 months
[PATCH] Add JENKINS_PROXY support to makebumpver
by Brian C. Lane
Somtimes the build system isn't on the same network. Add JENKINS_PROXY
to the .rhbzauth file and point it to a proxy that is.
Also catch connection errors and report them as a failure.
---
scripts/makebumpver | 48 ++++++++++++++++++++++++++++++------------------
1 file changed, 30 insertions(+), 18 deletions(-)
diff --git a/scripts/makebumpver b/scripts/makebumpver
index 488287b..c1483c9 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -45,6 +45,7 @@ class MakeBumpVer:
self.bzserver = 'bugzilla.redhat.com'
self.bzurl = "https://%s/xmlrpc.cgi" % self.bzserver
self.jenkins = None
+ self.jenkins_proxy = None
self.username = None
self.password = None
self.bz = None
@@ -63,6 +64,8 @@ class MakeBumpVer:
self.password = line[14:].strip('"\'')
elif line.startswith('JENKINS='):
self.jenkins = line[8:].strip('"\'')
+ elif line.startswith('JENKINS_PROXY='):
+ self.jenkins_proxy = line[14:].strip('"\'')
self.gituser = self._gitConfig('user.name')
self.gitemail = self._gitConfig('user.email')
@@ -460,25 +463,34 @@ class MakeBumpVer:
ret = False
- with closing(urllib.urlopen(self.jenkins)) as f:
- contents = f.readlines()
+ if self.jenkins_proxy:
+ proxies = { "http": self.jenkins_proxy }
+ else:
+ proxies = {}
- try:
- j = json.loads(contents[0])
- except (TypeError, ValueError):
- pass
- else:
- # Get the name of the job we should be looking for in jenkins.
- # This name is composed from the name of the project, plus the
- # branch of the project without any "-branch" stuff at the end.
- targetJob = self.name + "-" + self.git_branch
- if targetJob.endswith("-branch"):
- targetJob = targetJob[:-7]
-
- for job in j["jobs"]:
- if job["name"] == targetJob:
- ret = job["color"] == "blue"
- break
+ try:
+ with closing(urllib.urlopen(self.jenkins, proxies=proxies)) as f:
+ contents = f.readlines()
+
+ try:
+ j = json.loads(contents[0])
+ except (TypeError, ValueError):
+ pass
+ else:
+ # Get the name of the job we should be looking for in jenkins.
+ # This name is composed from the name of the project, plus the
+ # branch of the project without any "-branch" stuff at the end.
+ targetJob = self.name + "-" + self.git_branch
+ if targetJob.endswith("-branch"):
+ targetJob = targetJob[:-7]
+
+ for job in j["jobs"]:
+ if job["name"] == targetJob:
+ ret = job["color"] == "blue"
+ break
+ except IOError as e:
+ log.error("Jenkins check failed: %s", e)
+ return False
return ret
--
1.9.3
9 years, 2 months
[master][py3][PATCH] Replace xrange() with range()
by Vratislav Podzimek
xrange() doesn't exist in Python3 where range() works the same way as xrange in
Python2. Using range() in Python2 doesn't bring any significant overhead to
installation.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
dracut/driver-updates | 4 ++--
pyanaconda/ui/gui/utils.py | 2 +-
scripts/anaconda-yum | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dracut/driver-updates b/dracut/driver-updates
index acd5cd3..7554b4e 100755
--- a/dracut/driver-updates
+++ b/dracut/driver-updates
@@ -313,7 +313,7 @@ def fake_drivers(num):
""" Generate a number of fake drivers for testing
"""
drivers = []
- for i in xrange(0, num):
+ for i in range(0, num):
d = Driver()
d.source = "driver-%d" % i
d.flags = "modules"
@@ -476,7 +476,7 @@ def selection_menu(items, title, info_func, multi_choice=True, refresh=False):
num_items = page_length
else:
num_items = len(items) % page_length
- for i in xrange(0, num_items):
+ for i in range(0, num_items):
item_idx = ((page-1) * page_length) + i
if multi_choice:
if items[item_idx].selected:
diff --git a/pyanaconda/ui/gui/utils.py b/pyanaconda/ui/gui/utils.py
index 0e3c50c..775b6d7 100644
--- a/pyanaconda/ui/gui/utils.py
+++ b/pyanaconda/ui/gui/utils.py
@@ -176,7 +176,7 @@ def gtk_batch_map(action, items, args=(), pre_func=None, batch_size=1):
# process as many batches as user shouldn't notice
while tstamp - tstamp_start < NOTICEABLE_FREEZE:
- for _i in xrange(batch_size):
+ for _i in range(batch_size):
try:
action_item = queue.get_nowait()
if action_item is TERMINATOR:
diff --git a/scripts/anaconda-yum b/scripts/anaconda-yum
index 9c6dce1..82d7203 100755
--- a/scripts/anaconda-yum
+++ b/scripts/anaconda-yum
@@ -127,7 +127,7 @@ def run_yum_transaction(release, arch, yum_conf, install_root, ts_file, script_l
print("INFO: populate transaction set")
xdelay = xprogressive_delay()
- for retry_count in xrange(0, MAX_DOWNLOAD_RETRIES+1):
+ for retry_count in range(0, MAX_DOWNLOAD_RETRIES+1):
# retry count == 0 -> first attempt
# retry count > 0 -> retry
if retry_count:
@@ -292,7 +292,7 @@ class RPMCallback(object):
exception_message = ""
xdelay = xprogressive_delay()
- for retry_count in xrange(0, MAX_DOWNLOAD_RETRIES+1):
+ for retry_count in range(0, MAX_DOWNLOAD_RETRIES+1):
# retry count == 0 -> first attempt
# retry count > 0 -> retry
if retry_count and retry_message:
--
2.1.0
9 years, 2 months
[PATCH 1/2] Pass multiple args to runone in run_kickstart_tests.sh
by Brian C. Lane
Only quote the args, not the command, so that they get passed to
livemedia-creator as one group. Use eval so that bash doesn't eat the
kittens.
---
tests/kickstart_tests/run_kickstart_tests.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/kickstart_tests/run_kickstart_tests.sh b/tests/kickstart_tests/run_kickstart_tests.sh
index 9fbf67f..e977b4a 100755
--- a/tests/kickstart_tests/run_kickstart_tests.sh
+++ b/tests/kickstart_tests/run_kickstart_tests.sh
@@ -84,10 +84,10 @@ runone() {
kargs=$(kernel_args)
if [[ ${kargs} != "" ]]; then
- kargs="--kernel-args ${kargs}"
+ kargs="--kernel-args \"$kargs\""
fi
- livemedia-creator ${kargs} \
+ eval livemedia-creator ${kargs} \
--make-disk \
--iso "${IMAGE}" \
--ks ${ksfile} \
--
1.9.3
9 years, 2 months
[PATCH] Don't process continue-clicked events for windows that aren't shown.
by Chris Lumens
This is another tactic in trying to fix the frequent kickstart problem of
processing a continue-clicked event twice: once when the summary hub is up,
and then very shortly after when the progress hub is up. This fix will
ignore any events where the window we should be operating on is not the one
that is currently displayed.
---
pyanaconda/ui/gui/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 3927353..b775a54 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -746,7 +746,7 @@ class GraphicalUserInterface(UserInterface):
### SIGNAL HANDLING METHODS
###
def _on_continue_clicked(self, win, user_data=None):
- if not win.get_may_continue():
+ if not win.get_may_continue() or win != self._currentAction.window:
return
# If we're on the last screen, clicking Continue quits.
--
2.2.1
9 years, 3 months
[PATCH] Add back an empty %files for the anaconda metapackage
by David Shea
This is the difference between creating an empty package and creating no
package. Thanks, rpm.
---
anaconda.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 4159654..62f57c2 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -259,6 +259,8 @@ update-desktop-database &> /dev/null || :
update-desktop-database &> /dev/null || :
%endif
+%files
+
%files core -f %{name}.lang
%license COPYING
%{_unitdir}/*
--
2.1.0
9 years, 3 months