[PATCH 1/2] Explicitly set True/False in the bootloader setting (#885381).
by Chris Lumens
---
pyanaconda/ui/gui/spokes/lib/cart.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/cart.py b/pyanaconda/ui/gui/spokes/lib/cart.py
index 996c577..f3d2a26 100644
--- a/pyanaconda/ui/gui/spokes/lib/cart.py
+++ b/pyanaconda/ui/gui/spokes/lib/cart.py
@@ -210,11 +210,11 @@ class SelectedDisksDialog(GUIObject):
# previously selected device.
for row in self._store:
if row[ID_COL] == self._previousID:
- row[IS_BOOT_COL] = not row[IS_BOOT_COL]
+ row[IS_BOOT_COL] = False
break
# Then we select the new row.
- self._store[itr][IS_BOOT_COL] = not self._store[itr][IS_BOOT_COL]
+ self._store[itr][IS_BOOT_COL] = True
self._previousID = self._store[itr][ID_COL]
self._toggle_button_text(self._store[itr])
--
1.7.11.2
11 years, 4 months
[PATCH f18-branch] Wait for slower dhcp before running vnc server (#868777)
by Radek Vykydal
Regards NM's default autoconnections.
---
pyanaconda/vnc.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
index 2cdc947..833e2b5 100644
--- a/pyanaconda/vnc.py
+++ b/pyanaconda/vnc.py
@@ -170,6 +170,7 @@ class VncServer:
def startServer(self):
self.log.info(_("Starting VNC..."))
+ network.wait_for_dhcp()
# Lets call it from here for now.
try:
--
1.7.11.7
11 years, 4 months
[PATCH master, f18-branch] Network spoke: fix NMClient signal callback arguments (#885488)
by Radek Vykydal
---
pyanaconda/ui/gui/spokes/network.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index e8783ce..31145e2 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -408,10 +408,10 @@ class NetworkControlBox():
self.client.add_and_activate_connection(None, device, ap_obj_path,
None, None)
- def on_device_added(self, device, *args):
+ def on_device_added(self, client, device, *args):
self.add_device(device)
- def on_device_removed(self, device, *args):
+ def on_device_removed(self, client, device, *args):
self.remove_device(device)
def on_edit_connection(self, *args):
--
1.7.11.7
11 years, 4 months
f18 patches
by David Lehman
pyanaconda/storage/deviceaction.py | 2 +-
pyanaconda/storage/devices.py | 3 ++-
pyanaconda/ui/gui/spokes/custom.py | 8 +++-----
pyanaconda/ui/gui/spokes/lib/cart.py | 2 +-
pyanaconda/ui/gui/spokes/storage.py | 2 --
5 files changed, 7 insertions(+), 10 deletions(-)
In case anyone's wondering about the deep copy thing, we do a deep copy
of the main storage instance to play with in the custom spoke and those
copies of the devices end up replacing the original ones in the main
storage instance.
11 years, 4 months
custom UI patches
by Chris Lumens
These couple patches affect widgets being hidden/shown and made sensitive in
the custom part UI. They could be applied to f18-branch without hurting
anything, if we want.
- Chris
11 years, 4 months
[PATCH f18-branch] Add logging for networking and improve logging of ifcfg files
by Radek Vykydal
---
pyanaconda/network.py | 37 ++++++++++++++++++++++++-------------
pyanaconda/ui/gui/spokes/network.py | 3 ++-
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index c9c571b..afe3b56 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -212,13 +212,21 @@ def logIfcfgFile(path, message=""):
f = open(path, 'r')
content = f.read()
f.close()
+ else:
+ content = "file not found"
ifcfglog.debug("%s%s:\n%s" % (message, path, content))
def logIfcfgFiles(message=""):
- devprops = isys.getDeviceProperties(dev=None)
- for device in devprops:
- path = "%s/ifcfg-%s" % (netscriptsDir, device)
- logIfcfgFile(path, message)
+ ifcfglog.debug("content of files (%s):" % message)
+ for name in os.listdir(netscriptsDir):
+ if name.startswith("ifcfg-"):
+ if name == 'ifcfg-lo':
+ continue
+ path = os.path.join(netscriptsDir, name)
+ f = open(path, 'r')
+ content = f.read()
+ f.close()
+ ifcfglog.debug("%s:\n%s" % (path, content))
class NetworkDevice(IfcfgFile):
@@ -276,25 +284,20 @@ class NetworkDevice(IfcfgFile):
self.writeIfcfgFile()
def loadIfcfgFile(self):
- ifcfglog.debug("%s:\n%s" % (self.path, self.fileContent()))
- ifcfglog.debug("NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
- ifcfglog.debug("loadIfcfgFile %s from %s" % (self.iface, self.path))
+ ifcfglog.debug("loadIfcfFile %s" % self.path)
self.clear()
IfcfgFile.read(self)
self._dirty = False
- ifcfglog.debug("NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
-
def writeIfcfgFile(self):
# Write out the file only if there is a key whose
# value has been changed since last load of ifcfg file.
- ifcfglog.debug("%s:\n%s" % (self.path, self.fileContent()))
- ifcfglog.debug("NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
ifcfglog.debug("writeIfcfgFile %s to %s%s" % (self.iface, self.path,
("" if self._dirty else " not needed")))
-
if self._dirty:
+ ifcfglog.debug("old %s:\n%s" % (self.path, self.fileContent()))
+ ifcfglog.debug("writing NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
IfcfgFile.write(self)
self._dirty = False
@@ -424,6 +427,7 @@ def get_NM_object(path):
# Handle default auto connections created by NM upon start
# For server, those will be turned off in NetworkManager.conf
def createMissingDefaultIfcfgs():
+ rv = False
nm = get_NM_object(isys.NM_MANAGER_PATH)
dev_paths = nm.GetDevices()
settings = get_NM_object(isys.NM_SETTINGS_PATH)
@@ -450,10 +454,14 @@ def createMissingDefaultIfcfgs():
if con_hwaddr.upper() == hwaddr.upper():
setting['connection']['id'] = interface
con.Update(setting)
+ rv = True
+ log.debug("network: dumped ifcfg file for default autoconnection on %s" % interface)
break
else:
# if there is no connection, create default ifcfg
device_cfg.setDefaultConfig()
+ rv = True
+ return rv
def getDevices():
# TODO: filter with existence of ifcfg file?
@@ -995,9 +1003,12 @@ def setOnboot(ksdata):
# networking initialization and ksdata object update
def networkInitialize(ksdata):
+ log.debug("network: devices found %s" % getDevices())
+ logIfcfgFiles("network initialization")
if not flags.imageInstall:
# XXX: this should go to anaconda dracut
- createMissingDefaultIfcfgs()
+ if createMissingDefaultIfcfgs():
+ logIfcfgFiles("ifcfgs created")
# we set ONBOOT value using network --activate activate in dracut
# to get devices activated by NM, so set proper ONBOOT value
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index e5b91d5..e8783ce 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -41,7 +41,7 @@ from pyanaconda.ui.gui.categories.software import SoftwareCategory
from pyanaconda.ui.gui.hubs.summary import SummaryHub
from pyanaconda.ui.gui.utils import gtk_call_once
-from pyanaconda.network import NetworkDevice, netscriptsDir, kickstartNetworkData, getActiveNetDevs
+from pyanaconda.network import NetworkDevice, netscriptsDir, kickstartNetworkData, getActiveNetDevs, logIfcfgFiles
from gi.repository import GLib, GObject, Pango, Gio, NetworkManager, NMClient
import dbus
@@ -449,6 +449,7 @@ class NetworkControlBox():
if activate:
con, device = activate
gtk_call_once(self._activate_connection_cb, con, device)
+ logIfcfgFiles("nm-c-e run")
def _activate_connection_cb(self, con, device):
self.client.activate_connection(con, device,
--
1.7.11.7
11 years, 4 months
[rhel6-branch] [PATCH] Limit the maximum swap size to 10 % of disk space
by Vratislav Podzimek
On e.g. virtual machines with smalls disks and high amount of
memory it doesn't make sense to create large swap space leaving
only a little for the system and user data.
Also change comment to a docstring and document parameters.
Related: rhbz#878907
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
installclass.py | 8 +++++++-
iutil.py | 28 ++++++++++++++++++++++++----
kickstart.py | 18 ++++++++++++++++--
3 files changed, 47 insertions(+), 7 deletions(-)
diff --git a/installclass.py b/installclass.py
index a417762..fb07b03 100644
--- a/installclass.py
+++ b/installclass.py
@@ -191,7 +191,13 @@ class BaseInstallClass(object):
if bootreq:
autorequests.extend(bootreq)
- (minswap, maxswap) = iutil.swapSuggestion()
+ disk_space = 0
+ for disk in storage.disks:
+ if not storage.clearPartDisks \
+ or disk.name in storage.clearPartDisks:
+ disk_space += disk.size
+
+ (minswap, maxswap) = iutil.swapSuggestion(disk_space=disk_space)
autorequests.append(PartSpec(fstype="swap", size=minswap, maxSize=maxswap,
grow=True, asVol=True))
diff --git a/iutil.py b/iutil.py
index 3e3f903..3a9a583 100644
--- a/iutil.py
+++ b/iutil.py
@@ -40,6 +40,9 @@ import logging
log = logging.getLogger("anaconda")
program_log = logging.getLogger("program")
+# maximum ratio of swap size to disk size (10%)
+MAX_SWAP_DISK_RATIO = 0.1
+
#Python reimplementation of the shell tee process, so we can
#feed the pipe output into two places at the same time
class tee(threading.Thread):
@@ -450,10 +453,17 @@ def memInstalled():
return long(mem)
-## Suggest the size of the swap partition that will be created.
-# @param quiet Should size information be logged?
-# @return A tuple of the minimum and maximum swap size, in megabytes.
-def swapSuggestion(quiet=0, hibernation=False):
+def swapSuggestion(quiet=0, hibernation=False, disk_space=None):
+ """
+ Suggest the size of the swap partition that will be created.
+
+ @param quiet: Should size information be logged?
+ @param hibernation: Suggest size of the swap partition to support hibernation?
+ @param disk_space: Total disk space available
+ @return: A tuple of the minimum and maximum swap size, in megabytes.
+
+ """
+
mem = memInstalled()/1024
mem = ((mem/16)+1)*16
if not quiet:
@@ -479,6 +489,16 @@ def swapSuggestion(quiet=0, hibernation=False):
else:
log.info("Ignoring --hibernation option on systems with 64 GB of RAM or more")
+ if disk_space is not None:
+ max_swap = int(disk_space * MAX_SWAP_DISK_RATIO)
+ if swap > max_swap:
+ log.info("Suggested swap size (%(swap)d M) exceeds %(percent)d %% of "
+ "disk space, using %(percent)d %% of disk space (%(size)d M) "
+ "instead." % {"percent": MAX_SWAP_DISK_RATIO*100,
+ "swap": swap,
+ "size": max_swap})
+ swap = max_swap
+
if not quiet:
log.info("Swap attempt of %sM", swap)
diff --git a/kickstart.py b/kickstart.py
index 493a7c6..2d5144f 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -478,11 +478,18 @@ class LogVolData(commands.logvol.RHEL6_LogVolData):
storage.doAutoPart = False
+ disk_space = 0
+ for disk in storage.disks:
+ if not storage.clearPartDisks \
+ or disk.name in storage.clearPartDisks:
+ disk_space += disk.size
+
if self.mountpoint == "swap":
type = "swap"
self.mountpoint = ""
if self.recommended or self.hibernation:
- (self.size, self.maxSizeMB) = iutil.swapSuggestion(hibernation=self.hibernation)
+ (self.size, self.maxSizeMB) = \
+ iutil.swapSuggestion(hibernation=self.hibernation, disk_space=disk_space)
self.grow = True
else:
if self.fstype != "":
@@ -749,11 +756,18 @@ class PartitionData(commands.partition.RHEL6_PartData):
if self.disk == "":
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified BIOS disk %s cannot be determined" % self.onbiosdisk)
+ disk_space = 0
+ for disk in storage.disks:
+ if not storage.clearPartDisks \
+ or disk.name in storage.clearPartDisks:
+ disk_space += disk.size
+
if self.mountpoint == "swap":
type = "swap"
self.mountpoint = ""
if self.recommended or self.hibernation:
- (self.size, self.maxSizeMB) = iutil.swapSuggestion(hibernation=self.hibernation)
+ (self.size, self.maxSizeMB) = \
+ iutil.swapSuggestion(hibernation=self.hibernation, disk_space=disk_space)
self.grow = True
# if people want to specify no mountpoint for some reason, let them
--
1.7.11.7
11 years, 4 months
[f18-branch/master] Install default system for %packages --default (#869978)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
pyanaconda/packaging/yumpayload.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index f1de826..d5bd61a 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -1160,6 +1160,9 @@ reposdir=%s
"""
self._selectYumGroup("core")
+ if self.data.packages.default and self.environments:
+ self.selectEnvironment(self.environments[0])
+
for package in self.data.packages.packageList:
try:
self._selectYumPackage(package)
--
1.8.0
11 years, 4 months
[PATCH 1/4] Put the bad VG name into the error message (#884359).
by Chris Lumens
---
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 c87d039..702f118 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2050,7 +2050,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
log.debug("new VG name: %s" % name)
if name != vg_name and name in self.__storage.names:
self._error = _("Volume Group name %s is already in use. Not "
- "saving changes.")
+ "saving changes.") % name
self.set_info(self._error)
self.window.show_all()
return
--
1.7.11.2
11 years, 4 months
[PATCH master, f18-branch] Use updated connection settings object for default auto config files (#883383)
by Radek Vykydal
---
pyanaconda/network.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 640cd70..e7eabea 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -428,7 +428,6 @@ def createMissingDefaultIfcfgs():
nm = get_NM_object(isys.NM_MANAGER_PATH)
dev_paths = nm.GetDevices()
settings = get_NM_object(isys.NM_SETTINGS_PATH)
- con_paths = settings.ListConnections()
for devpath in dev_paths:
device = get_NM_object(devpath)
device_props_iface = dbus.Interface(device, isys.DBUS_PROPS_IFACE)
@@ -442,6 +441,7 @@ def createMissingDefaultIfcfgs():
continue
# check if there is a connection for the device (default autoconnection)
hwaddr = device_props_iface.Get(isys.NM_DEVICE_WIRED_IFACE, "HwAddress")
+ con_paths = settings.ListConnections()
for con_path in con_paths:
con = get_NM_object(con_path)
setting = con.GetSettings()
--
1.7.11.7
11 years, 4 months