[master] potfiles check review suggestions
by Vratislav Podzimek
I missed Thursday's and Friday's patch review, so I was not able to suggest
those two changes as part of the patch review process. Sending patches instead.
And yeah, I know especially PATCH 2/2 is a real neatpick. :)
Vratislav Podzimek (2):
Use sys.exit instead of os._exit in the potfiles test
Remove an unnecessary continue statement in the potfiles check
tests/gettext/gettext_potfiles.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
--
1.8.4.2
10 years, 5 months
[PATCH blivet rhel7-branch] (v2) Update format of iscsi device becoming multipath member (#740105)
by Radek Vykydal
This is slightly modified patch I already sent some months ago. Following
Dave's comments it is more general (checking all disks including FCoE, not only
iSCSI as the V1)
We repopulate device tree after add iscsi device dialog in which a login to
some target happened. One issue with this is that format of iscsi device
populated earlier that would make a multipath member together with iscsi device
added in later run of iscsi dialog is not updated to be of multipath_member
type.
So we'd need either 1) require adding of all multipath members in one add iscsi
dialog instance, which would require reworking UI to allow adding nodes of more
targets (ie targets with different IP reachable via different subnets) in one
iscsi dialog; or 2) update the original iscsi device format in devicetree.
---
blivet/devicetree.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index b48a4ea..c62c54a 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1018,6 +1018,14 @@ class DeviceTree(object):
# make sure any device we found is an md device
device = None
+ # newly added device (eg iSCSI) could make this one a multipath member
+ if device and device.isDisk and \
+ devicelibs.mpath.is_multipath_member(device.path) and \
+ device.format and device.format.type != "multipath_member":
+ log.debug("%s newly detected as multipath member, dropping old format" % device.name)
+ info["ID_FS_TYPE"] = "multipath_member"
+ device.format = formats.DeviceFormat()
+
#
# The first step is to either look up or create the device
#
--
1.7.11.7
10 years, 5 months
[blivet/anaconda f20/master] Size translations 3-D: The third dimension is terror
by David Shea
dlehman mentioned in IRC that the Size constructors are already pretty crowded
and don't need another function crudding them up, so here we go again with a
new parameter instead: spec works like before, acting as a string in user's
language, and en_spec is strings that have constant pieces, like a "MB" slapped
onto the end of a number.
10 years, 5 months
[PATCH] Support rnotes in SVG format (#1034407).
by Chris Lumens
Note: I've not tested that this works, but finding and loading the images
is a pretty crucial first step.
---
pyanaconda/ui/gui/hubs/progress.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py
index 55f7261..071d8dd 100644
--- a/pyanaconda/ui/gui/hubs/progress.py
+++ b/pyanaconda/ui/gui/hubs/progress.py
@@ -1,6 +1,6 @@
# Progress hub classes
#
-# Copyright (C) 2011-2012 Red Hat, Inc.
+# Copyright (C) 2011-2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
@@ -144,6 +144,11 @@ class ProgressHub(Hub):
GLib.source_remove(self._rnotes_id)
self._progressNotebook.set_current_page(0)
+ def _do_globs(self, path):
+ return glob.glob(path + "*/*.png") + \
+ glob.glob(path + "*/*.jpg") + \
+ glob.glob(path + "*/*.svg")
+
def _get_rnotes(self):
# We first look for rnotes in paths containing the language, then in
# directories without the language component. You know, just in case.
@@ -154,7 +159,7 @@ class ProgressHub(Hub):
all_lang_pixmaps = []
for path in paths:
- all_lang_pixmaps += glob.glob(path + "*/*.png") + glob.glob(path + "*/*.jpg")
+ all_lang_pixmaps += self._do_globs(path)
pixmap_langs = [pixmap.split(os.path.sep)[-2] for pixmap in all_lang_pixmaps]
best_lang = find_best_locale_match(os.environ["LANG"], pixmap_langs)
@@ -167,14 +172,13 @@ class ProgressHub(Hub):
# nothing found even for the default language, try non-localized rnotes
non_localized = []
for path in paths:
- non_localized += glob.glob(path + "*.png") + glob.glob(path + "*.jpg")
+ non_localized += self._do_globs(path)
return non_localized
best_lang_pixmaps = []
for path in paths:
- best_lang_pixmaps += (glob.glob(path + best_lang + "/*.png") +
- glob.glob(path + best_lang + "/*.jpg"))
+ best_lang_pixmaps += self._do_globs(path + best_lang)
return best_lang_pixmaps
--
1.8.3.1
10 years, 5 months
[PATCH] Fix a couple warnings from -Werror=format-security (#1036989).
by Chris Lumens
---
utils/dd/dd_extract.c | 2 +-
utils/dd/dd_list.c | 2 +-
widgets/src/BaseWindow.c | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/utils/dd/dd_extract.c b/utils/dd/dd_extract.c
index b6d6af5..46c8426 100644
--- a/utils/dd/dd_extract.c
+++ b/utils/dd/dd_extract.c
@@ -67,7 +67,7 @@ static const char *options_help [][2] = {
void show_help() {
int i;
- printf(usage);
+ printf("%s", usage);
for (i=0; options_help[i][0]; i++) {
printf(" -%c, --%-20s %s\n", options_help[i][0][0],
options_help[i][0],
diff --git a/utils/dd/dd_list.c b/utils/dd/dd_list.c
index 6fb19ca..28ce8d5 100644
--- a/utils/dd/dd_list.c
+++ b/utils/dd/dd_list.c
@@ -72,7 +72,7 @@ int globErrFunc(const char *epath, int eerrno)
void show_help() {
int i;
- printf(usage);
+ printf("%s", usage);
for (i=0; options_help[i][0]; i++) {
printf(" -%c, --%-20s %s\n", options_help[i][0][0],
options_help[i][0],
diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c
index 48a8393..77977cf 100644
--- a/widgets/src/BaseWindow.c
+++ b/widgets/src/BaseWindow.c
@@ -18,6 +18,7 @@
*/
#include <libintl.h>
+#include <locale.h>
#include <stdlib.h>
#include <string.h>
--
1.8.3.1
10 years, 5 months
[PATCH] Display how much free space is left in a container (#1035832).
by Chris Lumens
By container, I really just mean volume groups (and their thin equivalents,
though that is pretty weird looking). This doesn't really make sense to show
for btrfs since you can just keep slapping subvolumes in there all day long.
---
pyanaconda/ui/gui/spokes/custom.glade | 52 +++++++++++++++++++++++++----------
pyanaconda/ui/gui/spokes/custom.py | 43 +++++++++++++++++++----------
2 files changed, 66 insertions(+), 29 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade
index 592fd49..ffdc022 100644
--- a/pyanaconda/ui/gui/spokes/custom.glade
+++ b/pyanaconda/ui/gui/spokes/custom.glade
@@ -1153,20 +1153,6 @@ use. Try something else?</property>
</packing>
</child>
<child>
- <object class="GtkComboBoxText" id="containerCombo">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <signal name="changed" handler="on_container_changed" swapped="no"/>
- <signal name="changed" handler="on_value_changed" swapped="no"/>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="GtkButton" id="modifyContainerButton">
<property name="label" translatable="yes" context="GUI|Custom Partitioning|Configure">_Modify...</property>
<property name="visible">True</property>
@@ -1222,6 +1208,36 @@ use. Try something else?</property>
</packing>
</child>
<child>
+ <object class="GtkComboBox" id="containerCombo">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">containerStore</property>
+ <signal name="changed" handler="on_container_changed" swapped="no"/>
+ <signal name="changed" handler="on_value_changed" swapped="no"/>
+ <child>
+ <object class="GtkCellRendererText" id="descRenderer"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ <child>
+ <object class="GtkCellRendererText" id="freeSpaceRenderer">
+ <property name="xalign">1</property>
+ <property name="foreground">grey</property>
+ </object>
+ <attributes>
+ <attribute name="markup">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
<placeholder/>
</child>
</object>
@@ -2258,6 +2274,14 @@ until you click on the main menu's 'Begin Installation' button.</property>
</row>
</data>
</object>
+ <object class="GtkListStore" id="containerStore">
+ <columns>
+ <!-- column-name description -->
+ <column type="gchararray"/>
+ <!-- column-name freeSpace -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkTreeModelFilter" id="raidStoreFiltered">
<property name="child_model">raidLevelStore</property>
</object>
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 746832b..0a4337f 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -624,7 +624,7 @@ class HelpDialog(GUIObject):
self.window.destroy()
class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
- builderObjects = ["customStorageWindow",
+ builderObjects = ["customStorageWindow", "containerStore",
"partitionStore", "raidStoreFiltered", "raidLevelStore",
"addImage", "removeImage", "settingsImage",
"mountPointCompletion", "mountPointStore"]
@@ -741,6 +741,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._typeCombo = self.builder.get_object("deviceTypeCombo")
self._modifyContainerButton = self.builder.get_object("modifyContainerButton")
self._containerCombo = self.builder.get_object("containerCombo")
+ self._containerStore = self.builder.get_object("containerStore")
self._passphraseEntry = self.builder.get_object("passphraseEntry")
@@ -2363,9 +2364,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._device_container_encrypted = dialog.encrypted
self._device_container_size = dialog.size_policy
- def on_modify_container_clicked(self, button):
- container_name = self._containerCombo.get_active_text()
+ def _container_store_row(self, name, freeSpace=None):
+ if freeSpace is not None:
+ return [name, _("(%s free)") % size_str(freeSpace)]
+ else:
+ return [name, ""]
+ def on_modify_container_clicked(self, button):
+ container_name = self._containerStore[self._containerCombo.get_active()][0]
container = self.__storage.devicetree.getDeviceByName(container_name)
# pass the name along with any found vg since we could be modifying a
@@ -2389,11 +2395,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
container.format.label = self._device_container_name
container_exists = getattr(container, "exists", False)
- for idx, data in enumerate(self._containerCombo.get_model()):
+ for idx, data in enumerate(self._containerStore):
# we're looking for the original vg name
if data[0] == container_name:
- self._containerCombo.remove(idx)
- self._containerCombo.insert_text(idx, self._device_container_name)
+ self._containerStore.remove(idx)
+ c = self.__storage.devicetree.getDeviceByName(self._device_container_name)
+ self._containerStore.insert(idx, self._container_store_row(self._device_container_name, getattr(c, "freeSpace", None)))
self._containerCombo.set_active(idx)
self._modifyContainerButton.set_sensitive(not container_exists)
break
@@ -2401,7 +2408,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._update_selectors()
def on_container_changed(self, combo):
- container_name = combo.get_active_text()
+ ndx = combo.get_active()
+ if ndx == -1:
+ return
+
+ container_name = self._containerStore[ndx][0]
+
log.debug("new container selection: %s", container_name)
if container_name is None:
return
@@ -2417,9 +2429,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
hostname = self.data.network.hostname
name = self.__storage.suggestContainerName(hostname=hostname)
self.run_container_editor(name=name)
- for idx, data in enumerate(combo.get_model()):
+ for idx, data in enumerate(self._containerStore):
if data[0] == new_text:
- combo.insert_text(idx, self._device_container_name)
+ c = self.__storage.devicetree.getDeviceByName(self._device_container_name)
+ self._containerStore.insert(idx, self._container_store_row(self._device_container_name, getattr(c, "freeSpace", None)))
combo.set_active(idx) # triggers a call to this method
return
else:
@@ -2669,7 +2682,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
container_type_text = _(container_type_names[device_type])
self._containerLabel.set_text(container_type_text.title())
- self._containerCombo.remove_all()
+ self._containerStore.clear()
if device_type == DEVICE_TYPE_BTRFS:
containers = self.__storage.btrfsVolumes
else:
@@ -2677,7 +2690,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
default_seen = False
for c in containers:
- self._containerCombo.append_text(c.name)
+ self._containerStore.append(self._container_store_row(c.name, getattr(c, "freeSpace", None)))
if default_container and c.name == default_container:
default_seen = True
self._containerCombo.set_active(containers.index(c))
@@ -2691,13 +2704,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._device_container_size = container_size_policy
if not default_seen:
- self._containerCombo.append_text(default_container)
- self._containerCombo.set_active(len(self._containerCombo.get_model()) - 1)
+ self._containerStore.append(self._container_store_row(default_container))
+ self._containerCombo.set_active(len(self._containerStore) - 1)
- self._containerCombo.append_text(_(new_container_text) % {"container_type": container_type_text.lower()})
+ self._containerStore.append(self._container_store_row(_(new_container_text % {"container_type": container_type_text.lower()})))
self._containerCombo.set_tooltip_text(_(container_tooltip) % {"container_type": container_type_text.lower()})
if default_container is None:
- self._containerCombo.set_active(len(self._containerCombo.get_model()) - 1)
+ self._containerCombo.set_active(len(self._containerStore) - 1)
map(really_show, [self._containerLabel, self._containerCombo, self._modifyContainerButton])
--
1.8.3.1
10 years, 5 months
[f20-branch/master/rhel7-branch][PATCH] Don't crash on NTP lookup without network (#1026079)
by Martin Kolman
Also add a few comments about what the various exceptions mean.
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
pyanaconda/ntp.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pyanaconda/ntp.py b/pyanaconda/ntp.py
index a42a570..f0c051b 100644
--- a/pyanaconda/ntp.py
+++ b/pyanaconda/ntp.py
@@ -61,8 +61,13 @@ def ntp_server_working(server):
client.request(server)
except ntplib.NTPException:
return False
+ # address related error
except socket.gaierror:
return False
+ # socket related error
+ # (including "Network is unreachable")
+ except socket.error:
+ return False
return True
--
1.8.4.2
10 years, 5 months
[master/f20-branch][PATCH] Prepend the default layout for non-ascii layouts (#1039185)
by Vratislav Podzimek
Instead of appending the default layout for non-ascii layouts, we should prepend
it because that's how VConsole keymaps work.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/gui/spokes/welcome.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
index c6f411d..ae301e5 100644
--- a/pyanaconda/ui/gui/spokes/welcome.py
+++ b/pyanaconda/ui/gui/spokes/welcome.py
@@ -118,7 +118,7 @@ class WelcomeLanguageSpoke(LangLocaleHandler, StandaloneSpoke):
new_layouts = [keyboard.normalize_layout_variant(layouts[0])]
if not langtable.supports_ascii(layouts[0]):
# does not support typing ASCII chars, append the default layout
- new_layouts.append(DEFAULT_KEYBOARD)
+ new_layouts.insert(0, DEFAULT_KEYBOARD)
else:
log.error("Failed to get layout for chosen locale '%s'", locale)
new_layouts = [DEFAULT_KEYBOARD]
--
1.8.4.2
10 years, 5 months
[blivet 00/13] Some cleanup before adding a BTRFS resize method
by Anne Mulhern
These are just a bunch of preparatory patches. Most of them aren't too risky.
Remove... is semantics preserving and very low risk.
Factor... is just setting up to reuse some previous simple testing
infrastructure. Very low risk.
Add tests...just checking a few more properties that I missed last time. Very
low risk.
StorageDevice.minSize... changes a behavior.
Raise ValueError...just swapping on exception for another that looks better.
BTRFSSubVolume.volume...small behavior change.
Check that a BTRFS...I think no subvolume should ever have more than one
parent. If I'm wrong then this is a bug.
Robustify...minor change, seems consistent.
Add some baseline unit...these test what I see happening. If any of the tests
seem to expect the wrong thing, this is significant, because they do all pass.
Add a test that probably should fail...I think I've spotted a bug here, but
I'm not sure.
Remove redundant checks...if I'm wrong about how resize is called then this
patch is a bug, but also the current code is buggy.
Put additonal constraints on the ActionDevice initializer...if these constraints
are not valid then this is a bug.
Adjust currentSize methods...the actual changes are minor.
mulhern (13):
Remove redundant condition in if statement.
Factor state testing behavior into a separate class.
Add tests for a couple of additional properties for MDRaidArrayDevice.
StorageDevice.minSize returns 0 if format's minSize is 0.
Raise ValueError in BTRFS constructor if no parents specified.
BTRFSSubVolume.volume checks the class of its return value.
Check that a BTRFS subvolume has exactly one parent in constructor.
Robustify use of defaultSubVolumeID field.
Add some baseline unit tests for BTRFS devices.
Add a test that probably should fail.
Remove redundant checks in existing resize() methods.
Put additional constraints on the ActionResizeDevice initializer.
Adjust currentSize methods slightly.
blivet/deviceaction.py | 6 ++
blivet/devices.py | 98 ++++++++++++++++++-----------
tests/devices_test.py | 163 ++++++++++++++++++++++++++++++++++++++++++-------
3 files changed, 211 insertions(+), 56 deletions(-)
--
1.8.3.1
10 years, 5 months