[f18-branch/master] start vnc without ip address (#832510)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
In some cases the vnc server may start before the system has an IP
address. This isn't a fatal problem, it just makes it harder for the
user to know where to connect their vnc client.
This adds a 5 second retry when getting the IP. If that fails it will
still start the vnc server, and will print out instructions for
how to manually discover the IP address.
---
pyanaconda/vnc.py | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
index 833e2b5..ea2988f 100644
--- a/pyanaconda/vnc.py
+++ b/pyanaconda/vnc.py
@@ -42,14 +42,13 @@ stdoutLog = logging.getLogger("anaconda.stdout")
class VncServer:
def __init__(self, display="1", root="/", ip=None, name=None,
- desktop="Desktop", password="", vncconnecthost="",
+ password="", vncconnecthost="",
vncconnectport="", log_file="/tmp/vncserver.log",
pw_file="/tmp/vncpassword"):
self.display = display
self.root = root
self.ip = ip
self.name = name
- self.desktop = desktop
self.password = password
self.vncconnecthost = vncconnecthost
self.vncconnectport = vncconnectport
@@ -59,6 +58,10 @@ class VncServer:
self.anaconda = None
self.log = logging.getLogger("anaconda.stdout")
+ self.desktop = _("%(productName)s %(productVersion)s installation")\
+ % {'productName': product.productName,
+ 'productVersion': product.productVersion}
+
def setVNCPassword(self):
"""Set the vnc server password. Output to file. """
@@ -77,14 +80,19 @@ class VncServer:
def initialize(self):
"""Here is were all the relative vars get initialized. """
- self.ip = network.getFirstRealIP()
+ # Network may be slow. Try for 5 seconds
+ tries = 5
+ while tries:
+ self.ip = network.getFirstRealIP()
+ if self.ip:
+ break
+ time.sleep(1)
+ tries -= 1
if not self.ip:
- # Raise this here which will be caught higher up
- raise Exception("No IP addresses found.")
+ return
ipstr = self.ip
-
try:
hinfo = socket.gethostbyaddr(ipstr)
except Exception as e:
@@ -112,10 +120,6 @@ class VncServer:
% {'productName': product.productName,
'productVersion': product.productVersion,
'name': self.name}
- else:
- self.desktop = _("%(productName)s %(productVersion)s installation")\
- % {'productName': product.productName,
- 'productVersion': product.productVersion}
def openlogfile(self):
try:
@@ -166,18 +170,16 @@ class VncServer:
if self.connxinfo != None:
self.log.info(_("Please manually connect your vnc client to %s to begin the install.") % (self.connxinfo,))
else:
- self.log.info(_("Please manually connect your vnc client to begin the install."))
+ self.log.info(_("Please manually connect your vnc client to <IP ADDRESS>:%s "
+ "to begin the install. Switch to the shell (Ctrl-B 2) and "
+ "run 'ip addr' to find the <IP ADDRESS>.") % (self.display,))
def startServer(self):
self.log.info(_("Starting VNC..."))
network.wait_for_dhcp()
# Lets call it from here for now.
- try:
- self.initialize()
- except Exception, e:
- stdoutLog.critical("Could not initialize the VNC server: %s" % e)
- sys.exit(1)
+ self.initialize()
if self.password and len(self.password) < 6:
self.changeVNCPasswdWindow()
--
1.8.0.2
11 years, 5 months
[PATCH] Try fallback if none exactly matching language is found (#891487)
by Vratislav Podzimek
>From the language selection we get e.g. "Greek" as a language name. But
while iterating over all languages libxklavier knows we get "Greek, Modern
(1453-)" which is not an exact match. If exact match is not found we should
try to find language starting with the string we got from the language
selection.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/keyboard.py | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index d6c8f5c..e865f08 100755
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -440,15 +440,32 @@ class XklWrapper(object):
return self._switching_options
def get_default_language_layout(self, language):
- """Get the default layout for a given language"""
+ """Get the default layout for a given language."""
+
+ layouts = self.get_language_layouts(language)
+ if layouts:
+ #first layout (should exist for every language)
+ return layouts[0].name
+ else:
+ return None
+
+ def get_language_layouts(self, language):
+ """Get layouts for a given language."""
language_layouts = self._language_keyboard_variants.get(language, None)
- if not language_layouts:
- return None
+ if language_layouts:
+ return language_layouts
- #first layout (should exist for every language)
- return language_layouts[0].name
+ #else try some magic and if everything fails, return None
+ for (lang, layouts) in self._language_keyboard_variants.iteritems():
+ #XXX: some languages are returned in a weird form from the
+ # libxklavier iterations (e.g. "Greek, Modern (1453-)")
+ if lang.startswith(language):
+ #first layout (should exist for every language)
+ return layouts
+
+ return None
def get_default_lang_country_layout(self, language, country):
"""
@@ -457,7 +474,7 @@ class XklWrapper(object):
"""
- language_layouts = self._language_keyboard_variants.get(language, None)
+ language_layouts = self.get_language_layouts(language)
country_layouts = self._country_keyboard_variants.get(country, None)
if not language_layouts:
return None
--
1.7.11.7
11 years, 5 months
[PATCH master] Allow creation of growable extended partitions
by Jan Safranek
With following code snippet, pyanaconda.storage now creates an extended
partition on a disk, allocating the largest free space on the disk.
disk = storage.devicetree.getDeviceByName('sda')
partition = storage.newPartition(parents=[disk],size=1,grow=True,partType=parted.PARTITION_EXTENDED, primary=True)
action = pyanaconda.storage.deviceaction.ActionCreateDevice(partition)
storage.devicetree.registerAction(action)
print "before:", partition.isExtended
pyanaconda.storage.partitioning.doPartitioning(storage=storage)
print "after:", partition.isExtended
Without this patch, doPartitioning() would change the partition type from
parted.PARTITION_EXTENDED to parted.PARTITION_NORMAL and the second print
output would be different from the first one.
part_type variable comes from getNextPartitionType(), which either returns
NORMAL, if there is space for another primary partition in partition table
or EXTENDED, if the new partition should be logical. It says nothing about
application's reqest.
Signed-off-by: Jan Safranek <jsafrane(a)redhat.com>
---
pyanaconda/storage/partitioning.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index 87372fa..9a5f351 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -1060,6 +1060,10 @@ def allocatePartitions(storage, disks, partitions, freespace):
raise PartitioningError(_("not enough free space after "
"creating extended partition"))
+ # create extended partition if application requested so
+ if _part.isExtended and part_type == parted.PARTITION_NORMAL:
+ part_type = parted.PARTITION_EXTENDED
+
partition = addPartition(disklabel, free, part_type, _part.req_size)
log.debug("created partition %s of %dMB and added it to %s" %
(partition.getDeviceNodeName(), partition.getSize(),
11 years, 5 months
[PATCH] Update physical device's sysfs path for btrfs (sub)volumes. (#891443)
by David Lehman
---
pyanaconda/storage/devices.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 407eb10..207302f 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -3947,6 +3947,7 @@ class BTRFSDevice(StorageDevice):
def updateSysfsPath(self):
""" Update this device's sysfs path. """
log_method_call(self, self.name, status=self.status)
+ self.parents[0].updateSysfsPath()
self.sysfsPath = self.parents[0].sysfsPath
log.debug("%s sysfsPath set to %s" % (self.name, self.sysfsPath))
--
1.7.7.6
11 years, 5 months
[PATCH] Wrap text on the updates checkbox to fix screen placement (#888880).
by Chris Lumens
---
pyanaconda/ui/gui/spokes/source.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 91b3f89..528193d 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -648,6 +648,9 @@ class SourceSpoke(NormalSpoke):
self._mirrorlistCheckbox = self.builder.get_object("mirrorlistCheckbox")
+ self._noUpdatesCheckbox = self.builder.get_object("noUpdatesCheckbox")
+ self._noUpdatesCheckbox.get_children()[0].set_line_wrap(True)
+
self._verifyIsoButton = self.builder.get_object("verifyIsoButton")
def initialize(self):
--
1.7.11.2
11 years, 5 months
[PATCH 1/2] Add placeholder names to a couple strings (#890157).
by Chris Lumens
---
pyanaconda/bootloader.py | 7 ++++---
pyanaconda/ui/gui/spokes/custom.py | 8 ++++----
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 00644a7..10415e1 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1582,9 +1582,10 @@ class GRUB2(GRUB):
for p in parts:
start = p.geometry.start * p.disk.device.sectorSize
if not p.getFlag(PARTITION_BIOS_GRUB) and start < 1024*512:
- msg = _("%s may not have enough space for grub2 to embed "
- "core.img when using the %s filesystem on %s") \
- % (self.stage1_device.name, self.stage2_device.format.type, self.stage2_device.type)
+ msg = _("%(deviceName)s may not have enough space for grub2 to embed "
+ "core.img when using the %(fsType)s filesystem on %(deviceType)s") \
+ % {"deviceName": self.stage1_device.name, "fsType": self.stage2_device.format.type,
+ "deviceType": self.stage2_device.type}
log.error(msg)
self.errors.append(msg)
ret = False
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 70c77c8..95a4398 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2166,15 +2166,15 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
if selector._device.type == "mdarray":
total = selector._device.memberDevices
missing = total - len(selector._device.parents)
- txt = _("This Software RAID array is missing %d of %d member "
+ txt = _("This Software RAID array is missing %(missingMembers)d of %(totalMembers)d member "
"partitions. You can remove it or select a different "
- "device.") % (missing, total)
+ "device.") % {"missingMembers": missing, "totalMembers": total}
else:
total = selector._device.pvCount
missing = total - len(selector._device.parents)
- txt = _("This LVM Volume Group is missing %d of %d physical "
+ txt = _("This LVM Volume Group is missing %(missingPVs)d of %(totalPVs)d physical "
"volumes. You can remove it or select a different "
- "device.") % (missing, total)
+ "device.") % {"missingPVs": missing, "totalPVs": total}
optionsLabel.set_text(txt)
no_edit = True
elif getDeviceType(selector._device) is None:
--
1.7.11.2
11 years, 5 months
[master] More changes to support Spoke sharing with FB
by Martin Sivak
Patches in this set configure anaconda to actually look for
addon UI elements and use them properly.
Some of them also enhance the API for anaconda-firstboot
interaction. One last piece is missing there, the actual code to
save to disk what was configured during installation.
11 years, 5 months