[PATCH] Dump missing ifcfg ifles only for ethernet devices (#893892)
by Radek Vykydal
Don't crash on wwan devices, other types we might want to handle
here (bond, vlan) will be added when we support them.
---
pyanaconda/network.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 2bf7832..343297f 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -465,7 +465,7 @@ def createMissingDefaultIfcfgs():
device = get_NM_object(devpath)
device_props_iface = dbus.Interface(device, isys.DBUS_PROPS_IFACE)
devicetype = device_props_iface.Get(isys.NM_DEVICE_IFACE, "DeviceType")
- if devicetype == isys.NM_DEVICE_TYPE_WIFI:
+ if devicetype != isys.NM_DEVICE_TYPE_ETHERNET:
continue
# if there is no ifcfg file for the device
interface = str(device_props_iface.Get(isys.NM_DEVICE_IFACE, "Interface"))
--
1.7.11.7
11 years, 4 months
[PATCH master] Take over dhcp connection by NM for network root (eg nfs) (#883451, #893656)
by Radek Vykydal
We need to pass dhcp lease file to NM's dhclient also in case of
kickstart installs. For non-kickstart case, this is done in dracut,
modules.d/45ifcfg/write-ifcfg.sh.
See dracut's commit 66666c670a462548df4ea4c8069d54b8c309ecf4
---
dracut/parse-kickstart | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 333849b..24d0488 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -267,7 +267,8 @@ def ksnet_to_ifcfg(net, filename=None):
os.makedirs("/tmp/ifcfg")
ifcfg['DEVICE'] = dev
ifcfg['HWADDR'] = readsysfile("/sys/class/net/%s/address" % dev)
- ifcfg['UUID'] = readsysfile("/proc/sys/kernel/random/uuid")
+ uuid = readsysfile("/proc/sys/kernel/random/uuid")
+ ifcfg['UUID'] = uuid
# we set real ONBOOT value in anaconda, here
# we use it to activate devcies by NM on start
ifcfg['ONBOOT'] = "yes" if net.activate else "no"
@@ -305,6 +306,15 @@ def ksnet_to_ifcfg(net, filename=None):
# TODO: dhcpclass, ethtool, essid/wepkey/wpakay, etc.
+ if net.bootProto == 'dhcp':
+ srcpath = "/tmp/dhclient.%s.lease" % dev
+ dstdir = "/tmp/ifcfg-leases"
+ dstpath = "%s/dhclient-%s-%s.lease" % (dstdir, uuid, dev)
+ if os.path.exists(srcpath):
+ if not os.path.isdir(dstdir):
+ os.makedirs(dstdir)
+ os.system("cp %s %s" % (srcpath, dstpath))
+
try:
log.info("writing ifcfg for %s", dev)
outf = open(filename, "w")
@@ -312,6 +322,7 @@ def ksnet_to_ifcfg(net, filename=None):
for k,v in ifcfg.items():
outf.write("%s=%s\n" % (k,v))
outf.close()
+
except IOError as e:
log.error("can't write %s: %s" % (filename, str(e)))
else:
--
1.7.11.7
11 years, 4 months
[PATCH][rhel6-branch] Fix nompath handling in advanced storage filter path.
by David Lehman
Resolves: rhbz#821042
---
iw/filter_gui.py | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index cccebbd..6c59477 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -456,8 +456,12 @@ class FilterWindow(InstallWindow):
udev_get_block_devices())
writeMultipathConf(friendly_names=True)
+ if os.path.exists("/etc/multipath.conf"):
+ (new_singlepaths, new_mpaths, new_partitions) = identifyMultipaths(new_disks)
+ else:
+ new_singlepaths = new_disks
+ new_mpaths = []
- (new_singlepaths, new_mpaths, new_partitions) = identifyMultipaths(new_disks)
(new_raids, new_nonraids) = self.split_list(lambda d: isRAID(d) and not isCCISS(d),
new_singlepaths)
@@ -622,14 +626,18 @@ class FilterWindow(InstallWindow):
udev_get_block_devices())
writeMultipathConf(friendly_names=True)
+ if os.path.exists("/etc/multipath.conf"):
+ # identifyMultipaths() uses 'multipath -d' and 'multipath -ll' to find
+ # mpath devices. In case there are devices already set up they won't
+ # show up (or show up with a wrong name). Flush those first.
+ log.info("filter_gui: flushing all multipath devices.")
+ flush_mpaths()
+
+ (singlepaths, mpaths, partitions) = identifyMultipaths(disks)
+ else:
+ mpaths = []
+ singlepaths = disks
- # identifyMultipaths() uses 'multipath -d' and 'multipath -ll' to find
- # mpath devices. In case there are devices already set up they won't
- # show up (or show up with a wrong name). Flush those first.
- log.info("filter_gui: flushing all multipath devices.")
- flush_mpaths()
-
- (singlepaths, mpaths, partitions) = identifyMultipaths(disks)
# The device list could be really long, so we really only want to
# iterate over it the bare minimum of times. Dividing this list up
# now means fewer elements to iterate over later.
--
1.7.7.6
11 years, 4 months
[python-meh] Callbacks support
by Vratislav Podzimek
It was requested by some people (Radek included) that we could append
some more info to our bugreports. But python-meh only supports
appending/attaching existing files. The following two patches add
support for callbacks that could provide some additional info (e.g. by
calling 'lsblk', 'nmcli' etc. and capturing output).
PATCH 1/2 is the main one.
PATCH 2/2 could be squashed, but I'm not sure if it gets approved so I'm
proposing it separately.
Vratislav Podzimek (2):
Add support for callbacks providing additional data
Allow callbacks marked as attachment only
meh/__init__.py | 37 +++++++++++++++++++++++++++++++++++++
meh/dump.py | 14 ++++++++++++++
meh/handler.py | 7 +++++++
tests/callbacks.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 104 insertions(+)
create mode 100644 tests/callbacks.py
--
1.7.11.7
11 years, 4 months
[PATCH] Rework the reclaim dialog to have a resize slider.
by Chris Lumens
This required changing the toolbar of buttons into a regular hbox. I've also
removed the percent bar since that's duplicate information and gets rid of a
couple numbers (this dialog has way too many), and changed the wording in the
reclaimable space column for unshrinkable devices to say so. That gets rid of
some more numbers.
Related: #875944
---
pyanaconda/ui/gui/spokes/lib/resize.glade | 80 ++++++++++++++++++-------------
pyanaconda/ui/gui/spokes/lib/resize.py | 77 +++++++++++++++++++----------
2 files changed, 98 insertions(+), 59 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.glade b/pyanaconda/ui/gui/spokes/lib/resize.glade
index 05f5ad3..11eefcb 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.glade
+++ b/pyanaconda/ui/gui/spokes/lib/resize.glade
@@ -11,14 +11,14 @@
<column type="gchararray"/>
<!-- column-name diskReclaimableSize -->
<column type="gchararray"/>
- <!-- column-name diskReclaimablePct -->
- <column type="gint"/>
<!-- column-name diskAction -->
<column type="gchararray"/>
<!-- column-name diskEditable -->
<column type="gboolean"/>
<!-- column-name diskTooltip -->
<column type="gchararray"/>
+ <!-- column-name diskResizeTarget -->
+ <column type="gfloat"/>
</columns>
</object>
<object class="GtkDialog" id="resizeDialog">
@@ -166,13 +166,6 @@
<attribute name="markup">3</attribute>
</attributes>
</child>
- <child>
- <object class="GtkCellRendererProgress" id="percentRenderer"/>
- <attributes>
- <attribute name="visible">6</attribute>
- <attribute name="value">4</attribute>
- </attributes>
- </child>
</object>
</child>
<child>
@@ -181,8 +174,8 @@
<child>
<object class="GtkCellRendererText" id="actionRenderer"/>
<attributes>
- <attribute name="visible">6</attribute>
- <attribute name="text">5</attribute>
+ <attribute name="visible">5</attribute>
+ <attribute name="text">4</attribute>
</attributes>
</child>
</object>
@@ -197,54 +190,73 @@
</packing>
</child>
<child>
- <object class="GtkToolbar" id="toolbar1">
+ <object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="margin_bottom">6</property>
- <property name="toolbar_style">text</property>
- <style>
- <class name="inline-toolbar"/>
- </style>
<child>
- <object class="GtkToolButton" id="preserveButton">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
+ <object class="GtkButton" id="preserveButton">
<property name="label" translatable="yes">_Preserve</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="valign">center</property>
<property name="use_underline">True</property>
- <accelerator key="p" signal="clicked" modifiers="GDK_MOD1_MASK"/>
<signal name="clicked" handler="on_preserve_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkToolButton" id="shrinkButton">
+ <object class="GtkButton" id="deleteButton">
+ <property name="label" translatable="yes">_Delete</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Shrink</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="valign">center</property>
<property name="use_underline">True</property>
- <accelerator key="s" signal="clicked" modifiers="GDK_MOD1_MASK"/>
- <signal name="clicked" handler="on_shrink_clicked" swapped="no"/>
+ <signal name="clicked" handler="on_delete_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <object class="GtkToolButton" id="deleteButton">
+ <object class="GtkButton" id="shrinkButton">
+ <property name="label" translatable="yes">_Shrink to</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Delete</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="valign">center</property>
<property name="use_underline">True</property>
- <accelerator key="d" signal="clicked" modifiers="GDK_MOD1_MASK"/>
- <signal name="clicked" handler="on_delete_clicked" swapped="no"/>
+ <signal name="clicked" handler="on_shrink_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScale" id="resizeSlider">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="margin_left">12</property>
+ <property name="margin_right">12</property>
+ <property name="round_digits">1</property>
+ <property name="digits">0</property>
+ <property name="value_pos">bottom</property>
+ <signal name="format-value" handler="resize_slider_format" swapped="no"/>
+ <signal name="value-changed" handler="on_resize_value_changed" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
index 31d3624..731e6b9 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.py
+++ b/pyanaconda/ui/gui/spokes/lib/resize.py
@@ -38,10 +38,10 @@ DEVICE_ID_COL = 0
DESCRIPTION_COL = 1
FILESYSTEM_COL = 2
RECLAIMABLE_COL = 3
-PERCENT_COL = 4
-ACTION_COL = 5
-EDITABLE_COL = 6
-TOOLTIP_COL = 7
+ACTION_COL = 4
+EDITABLE_COL = 5
+TOOLTIP_COL = 6
+RESIZE_TARGET_COL = 7
PRESERVE = N_("Preserve")
SHRINK = N_("Shrink")
@@ -84,6 +84,7 @@ class ResizeDialog(GUIObject):
self._preserveButton = self.builder.get_object("preserveButton")
self._shrinkButton = self.builder.get_object("shrinkButton")
self._deleteButton = self.builder.get_object("deleteButton")
+ self._resizeSlider = self.builder.get_object("resizeSlider")
def _description(self, part):
# First, try to find the partition in some known Root. If we find
@@ -120,7 +121,6 @@ class ResizeDialog(GUIObject):
for disk in disks:
# First add the disk itself.
editable = not disk.protected
- percent = 100
if disk.partitioned:
fstype = ""
@@ -133,10 +133,10 @@ class ResizeDialog(GUIObject):
"%s %s" % (size_str(disk.size), disk.description),
fstype,
"<span foreground='grey' style='italic'>%s total</span>",
- percent,
_(PRESERVE),
editable,
- self._get_tooltip(disk)])
+ self._get_tooltip(disk),
+ disk.size])
if disk.partitioned:
# Then add all its partitions.
@@ -147,25 +147,26 @@ class ResizeDialog(GUIObject):
# Devices that are not resizable are still deletable.
if dev.resizable:
freeSize = dev.size - dev.minSize
+ resizeString = _("%s of %s") % (size_str(freeSize), size_str(dev.size))
if not dev.protected:
canShrinkSomething = True
else:
freeSize = dev.size
+ resizeString = _("Not resizeable")
self._diskStore.append(itr, [dev.id,
self._description(dev),
dev.format.type,
- _("%s of %s") % (size_str(freeSize), size_str(dev.size)),
- int((freeSize/dev.size) * 100),
+ resizeString,
_(PRESERVE),
not dev.protected,
- self._get_tooltip(dev)])
+ self._get_tooltip(dev),
+ dev.size])
diskReclaimableSpace += freeSize
# And then go back and fill in the total reclaimable space for the
# disk, now that we know what each partition has reclaimable.
self._diskStore[itr][RECLAIMABLE_COL] = self._diskStore[itr][RECLAIMABLE_COL] % size_str(diskReclaimableSpace)
- self._diskStore[itr][PERCENT_COL] = int((diskReclaimableSpace/disk.size)*100)
totalDisks += 1
totalReclaimableSpace += diskReclaimableSpace
@@ -197,7 +198,7 @@ class ResizeDialog(GUIObject):
text = _("Total selected space to reclaim: <b>%s</b>") % size_str(selectedReclaimable)
self._selected_label.set_markup(text)
- def _update_buttons(self, row):
+ def _update_action_buttons(self, row):
device = self.storage.devicetree.getDeviceByID(row[DEVICE_ID_COL])
# Disks themselves may be editable in certain ways, but they are never
@@ -205,6 +206,7 @@ class ResizeDialog(GUIObject):
self._preserveButton.set_sensitive(row[EDITABLE_COL])
self._shrinkButton.set_sensitive(row[EDITABLE_COL] and not device.isDisk)
self._deleteButton.set_sensitive(row[EDITABLE_COL])
+ self._resizeSlider.set_sensitive(False)
if not row[EDITABLE_COL]:
return
@@ -213,15 +215,27 @@ class ResizeDialog(GUIObject):
# button insensitive.
self._shrinkButton.set_sensitive(device.resizable)
+ # Set up the slider for this device, pulling out any previously
+ # given shrink value as the default. Even if the device is not
+ # resizeable, we want to set up the right numbers here so it doesn't
+ # look weird.
+ self._resizeSlider.set_range(device.minSize, device.size)
+ self._resizeSlider.set_value(row[RESIZE_TARGET_COL])
+
# Then, disable the button for whatever action is currently selected.
# It doesn't make a lot of sense to allow clicking that.
if row[ACTION_COL] == _(PRESERVE):
self._preserveButton.set_sensitive(False)
elif row[ACTION_COL] == _(SHRINK):
self._shrinkButton.set_sensitive(False)
+ self._resizeSlider.set_sensitive(True)
elif row[ACTION_COL] == _(DELETE):
self._deleteButton.set_sensitive(False)
+ def _update_reclaim_button(self, got):
+ need = self.payload.spaceRequired
+ self._resizeButton.set_sensitive(got >= need)
+
def refresh(self, disks):
super(ResizeDialog, self).refresh()
@@ -238,7 +252,7 @@ class ResizeDialog(GUIObject):
# Signal handlers.
def _sumReclaimableSpace(self, model, path, itr, *args):
- (editable, action, ident) = model.get(itr, EDITABLE_COL, ACTION_COL, DEVICE_ID_COL)
+ (editable, action, ident, targetSize) = model.get(itr, EDITABLE_COL, ACTION_COL, DEVICE_ID_COL, RESIZE_TARGET_COL)
if not editable:
return False
@@ -247,10 +261,7 @@ class ResizeDialog(GUIObject):
if action == _(PRESERVE):
return False
if action == _(SHRINK):
- if device.resizable:
- self._selectedReclaimableSpace += (device.size - device.minSize)
- else:
- self._selectedReclaimableSpace += device.size
+ self._selectedReclaimableSpace += device.size - targetSize
elif action == _(DELETE):
self._selectedReclaimableSpace += device.size
@@ -300,14 +311,11 @@ class ResizeDialog(GUIObject):
self._diskStore.foreach(self._sumReclaimableSpace, None)
self._update_labels(selectedReclaimable=self._selectedReclaimableSpace)
- got = Size(spec="%s MB" % self._selectedReclaimableSpace)
- need = self.payload.spaceRequired
- self._resizeButton.set_sensitive(got >= need)
-
- self._update_buttons(selectedRow)
+ self._update_reclaim_button(Size(spec="%s MB" % self._selectedReclaimableSpace))
+ self._update_action_buttons(selectedRow)
def _scheduleActions(self, model, path, itr, *args):
- (editable, action, ident) = model.get(itr, EDITABLE_COL, ACTION_COL, DEVICE_ID_COL)
+ (editable, action, ident, target) = model.get(itr, EDITABLE_COL, ACTION_COL, DEVICE_ID_COL, RESIZE_TARGET_COL)
device = self.storage.devicetree.getDeviceByID(ident)
@@ -318,7 +326,7 @@ class ResizeDialog(GUIObject):
return False
elif action == _(SHRINK):
if device.resizable:
- self.storage.resizeDevice(device, device.minSize)
+ self.storage.resizeDevice(device, target)
else:
self.storage.recursiveRemove(device)
elif action == _(DELETE):
@@ -348,4 +356,23 @@ class ResizeDialog(GUIObject):
if not itr:
return
- self._update_buttons(self._diskStore[itr])
+ self._update_action_buttons(self._diskStore[itr])
+
+ def on_resize_value_changed(self, rng):
+ selection = self.builder.get_object("diskView-selection")
+ (model, itr) = selection.get_selected()
+
+ # Update the target size in the store.
+ model[itr][RESIZE_TARGET_COL] = rng.get_value()
+
+ # Update the "Total selected space" label.
+ delta = rng.get_adjustment().get_upper()-rng.get_value()
+ self._update_labels(selectedReclaimable=self._selectedReclaimableSpace+delta)
+
+ # And then the reclaim button, in case they've made enough space.
+ self._update_reclaim_button(self._selectedReclaimableSpace+delta)
+
+ def resize_slider_format(self, scale, value):
+ # This makes the value displayed under the slider prettier than just a
+ # single number.
+ return size_str(value)
--
1.7.11.2
11 years, 4 months
[PATCH] g_type_init call is no longer needed
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
pyanaconda/isys/iface.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/pyanaconda/isys/iface.c b/pyanaconda/isys/iface.c
index af64264..299f7ab 100644
--- a/pyanaconda/isys/iface.c
+++ b/pyanaconda/isys/iface.c
@@ -178,8 +178,6 @@ char *iface_ip2str(char *ifname, int family) {
return NULL;
}
- g_type_init();
-
client = nm_client_new();
if (!client) {
return NULL;
@@ -420,8 +418,6 @@ gboolean is_nm_connected(void) {
NMState state;
NMClient *client = NULL;
- g_type_init();
-
client = nm_client_new();
if (!client)
return FALSE;
@@ -440,8 +436,6 @@ gboolean is_nm_running(void) {
gboolean running;
NMClient *client = NULL;
- g_type_init();
-
client = nm_client_new();
if (!client)
return FALSE;
@@ -456,8 +450,6 @@ gboolean is_iface_activated(char * ifname) {
NMClient *client = NULL;
const GPtrArray *devices;
- g_type_init();
-
client = nm_client_new();
if (!client)
return FALSE;
--
1.8.0.2
11 years, 4 months
[F19] Bits and pieces
by Martin Sivak
The second patch contains the same fix Vrata sent today (Storage
thread never ends because we forgot to free the import lock).
Do not call exit unless it is a real error, firstboot uses
Anaconda in a library form and I really need to be able to
execute more code when GUI ends.
11 years, 4 months
[master] Storage never ends
by Vratislav Podzimek
When writing patches for the HW clock heuristic I found out that on master
the storageInitialize thread never ends. The following is the patch fixing
this and probably a lot of other stuff.
Vratislav Podzimek (1):
Always release the imp lock
pyanaconda/ui/common.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
1.7.11.7
11 years, 4 months
Re: [PATCH] anaconda realm command
by Vratislav Podzimek
On Tue, 2012-12-04 at 13:33 +0100, Stef Walter wrote:
> On 12/04/2012 12:19 PM, Vratislav Podzimek wrote:
> > On Tue, 2012-12-04 at 11:51 +0100, Stef Walter wrote:
> >> No. We do however need it in the installer. Once it's there, then the
> >> anaconda realm command installs it (if necessary) on the system.
> > Adding 'Requires: realmd' in spec file ensures that realm command is
> > available during installation.
>
> Alright.
>
> >> Should I remove it from the line above? What does the above reflect?
> >> Because Anaconda does need it in this case. LMK.
> > This is the list of packages Anaconda needs for running some
> > post-install setup commands in chroot. But in this case realm command is
> > run only in cases when realmd is also added by anaconda/pykickstart
> > realm command, right?
>
> The realmd package (and other necessary packages for the realm) are
> added to the list of packages to be installed on the system if the
> 'realm' command is present, and the realm is discoverable.
>
> So, I've realmd from the list of packages in from yuminstall.py
>
> Cheers,
>
> Stef
>
Since there are no additional comments, I'm pushing the patch for
setting the local hostname during installation. The rest is going to end
up in a separate addon.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
11 years, 4 months
[PATCH] drop fcoe-utils dependency for s390x (rhbz#894025)
by Samantha N. Bueno
fcoe-utils is not supported by s390x, which causes lorax builds to
fail; drop the requirement for now.
Resolves: rhbz#894025
---
anaconda.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 3931f05..92cab71 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -162,7 +162,9 @@ Requires: nm-connection-editor
Requires: dhclient
Requires: anaconda-yum-plugins
Requires: libselinux-python >= %{libselinuxver}
+%ifnarch s390 s390x
Requires: fcoe-utils >= %{fcoeutilsver}
+%endif
Requires: kbd
Requires: chrony
Requires: rdate
--
1.7.11.7
11 years, 4 months