[PATCH] Fix traceback when /etc/sysconfig/i18n doesn't exist (#849967)
by Vratislav Podzimek
---
firstboot/frontend.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/firstboot/frontend.py b/firstboot/frontend.py
index 2735303..04245e0 100644
--- a/firstboot/frontend.py
+++ b/firstboot/frontend.py
@@ -42,11 +42,14 @@ class Frontend:
self.wm_pid = None
def set_lang(self):
- i18n = shlex.split(open(I18N).read())
- i18n = dict(item.split('=') for item in i18n)
- if 'LANG' in i18n:
- log.info('setting LANG to %s', i18n['LANG'])
- os.environ['LANG'] = i18n['LANG']
+ try:
+ i18n = shlex.split(open(I18N).read())
+ i18n = dict(item.split('=') for item in i18n)
+ if 'LANG' in i18n:
+ log.info('setting LANG to %s', i18n['LANG'])
+ os.environ['LANG'] = i18n['LANG']
+ except:
+ os.environ.setdefault("LANG", "en_US.UTF-8")
def startx(self):
def sigusr1_handler(num, frame):
--
1.7.11.4
11 years, 9 months
First attempt at a graphical root pw spoke
by Jesse Keating
The root password spoke is optional, and defaults to a locked account. But
if a user does enter the spoke and tries to set a password (doesn't just leave
the boxes blank) the password will be validated and the spoke will become
incomplete if the password doesn't validate. The user will have to enter the
spoke again to find out why it didn't validate.
This borrows code from the old pyanaconda/iw/account_gui.py, and tries to
re-use as many strings as possible. I think there are only one or two new
strings here.
Comments and commit comments try to explain what's going on with the code.
I've tested it with run-spoke and run-hub and it seems to get the right data
in place, which might be enough for F18 alpha.
-jlk
11 years, 9 months
[PATCH] Put traceback reports on a diet.
by Chris Lumens
This updates what attributes get written out to the traceback file for the
newui. In particular, it avoids writing out all the yum stuff that makes the
traceback file grow over 2 MB and take nearly a minute to pickle.
It's entirely possible this is either skipping too much or writing out too
much still, but we can work on that over time.
---
pyanaconda/exception.py | 29 +++++++----------------------
1 file changed, 7 insertions(+), 22 deletions(-)
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 70deed5..2ac513b 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -146,28 +146,13 @@ def initExceptionHandling(anaconda):
conf = Config(programName="anaconda",
programVersion=isys.getAnacondaVersion(),
- attrSkipList=[ "backend.ayum",
- "backend.dlpkgs",
- "accounts",
- "bootloader.password",
- "comps",
- "hdList",
- "ksdata",
- "instLanguage.font",
- "instLanguage.kbd",
- "instLanguage.info",
- "instLanguage.localeInfo",
- "instLanguage.nativeLangNames",
- "instLanguage.tz",
- "keyboard._mods._modelDict",
- "keyboard.modelDict",
- "storage.encryptionPassphrase",
- "users.rootPassword",
- "tmpData",
- "intf.icw.buff",
- "intf.icw.currentWindow.storage.encryptionPassphrase",
- "intf.icw.stockButtons",
- ],
+ attrSkipList=["_intf._actions",
+ "_intf.storage.bootloader.password",
+ "_intf.storage.data",
+ "_bootloader.encrypted_password",
+ "_bootloader.password",
+ "payload._groups",
+ "payload._yum"],
localSkipList=[ "passphrase", "password" ],
fileList=fileList)
handler = AnacondaExceptionHandler(conf, anaconda.intf, ReverseExceptionDump)
--
1.7.11.2
11 years, 9 months
[PATCH 2/3] parse-kickstart: simplify logging
by Will Woods
Systemd handles the tricky bits of logging for us now. Yay!
---
dracut/parse-kickstart | 25 +++----------------------
1 file changed, 3 insertions(+), 22 deletions(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 851cecb..a9da517 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -169,31 +169,12 @@ class DracutHandler(handlerclass):
self.output.append(command.dracut_args(args, lineno, obj))
return obj
-# set up logging
-class KmsgFormatter(logging.Formatter):
- '''Formats log output for /dev/kmsg like dracut does.'''
- def format(self, record):
- if record.levelno <= logging.INFO: tag = "<30>"
- elif record.levelno <= logging.WARNING: tag = "<28>"
- else: tag = "<24>"
- return tag + logging.Formatter.format(self, record)
-def init_logger(level=logging.WARNING):
- if 'rd.debug' in proc_cmdline:
+def init_logger(level=None):
+ if level is None and 'rd.debug' in proc_cmdline:
level = logging.DEBUG
- elif 'rd.info' in proc_cmdline:
- level = logging.INFO
logfmt = "%(name)s %(levelname)s: %(message)s"
- stderr = logging.StreamHandler()
- stderr.setFormatter(logging.Formatter(logfmt))
+ logging.basicConfig(format=logfmt, level=level)
logger = logging.getLogger('parse-kickstart')
- logger.setLevel(level)
- logger.addHandler(stderr)
- try:
- kmsg = logging.FileHandler("/dev/kmsg", "w")
- kmsg.setFormatter(KmsgFormatter(logfmt))
- logger.addHandler(kmsg)
- except IOError:
- pass
return logger
def is_mac(addr):
--
1.7.11.4
11 years, 9 months
[PATCH 3/3] remove dead code (setMethodstr, expandFTPMethod)
by Will Woods
Nothing uses a method/repo of 'cdrom://<dev>:<path>' anymore, and
nothing passes a method like '@/tmp/filename', so this code is all
useless.
---
anaconda | 24 +-----------------------
pyanaconda/__init__.py | 15 ---------------
2 files changed, 1 insertion(+), 38 deletions(-)
diff --git a/anaconda b/anaconda
index 88f4fa9..f86cdf4 100755
--- a/anaconda
+++ b/anaconda
@@ -321,20 +321,6 @@ def setupLoggingFromOpts(opts):
if opts.syslog:
anaconda_log.logger.remote_syslog = opts.syslog
-# ftp installs pass the password via a file in /tmp so
-# ps doesn't show it
-def expandFTPMethod(str):
- ret = None
-
- try:
- filename = str[1:]
- ret = open(filename, "r").readline()
- ret = ret[:len(ret) - 1]
- os.unlink(filename)
- return ret
- except:
- return None
-
def gtk_warning(title, reason):
import gtk
dialog = gtk.MessageDialog(type = gtk.MESSAGE_ERROR,
@@ -748,17 +734,9 @@ if __name__ == "__main__":
anaconda.updateSrc = opts.updateSrc
if opts.method:
- if opts.method[0] == '@':
- opts.method = expandFTPMethod(opts.method)
-
- anaconda.setMethodstr(opts.method)
- else:
- anaconda.methodstr = None
+ anaconda.methodstr = opts.method
if opts.stage2:
- if opts.stage2[0] == '@':
- opts.stage2 = expandFTPMethod(opts.stage2)
-
anaconda.stage2 = opts.stage2
if opts.noverifyssl:
diff --git a/pyanaconda/__init__.py b/pyanaconda/__init__.py
index 5f2ccbe..4c39841 100644
--- a/pyanaconda/__init__.py
+++ b/pyanaconda/__init__.py
@@ -237,21 +237,6 @@ class Anaconda(object):
f.write('Section "Device"\n\tIdentifier "Videocard0"\n\tDriver "%s"\nEndSection\n' % self.xdriver)
f.close()
- def setMethodstr(self, methodstr):
- if methodstr.startswith("cdrom://"):
- (device, tree) = string.split(methodstr[8:], ":", 1)
-
- if not tree.startswith("/"):
- tree = "/%s" %(tree,)
-
- if device.startswith("/dev/"):
- device = device[5:]
-
- self.mediaDevice = device
- self.methodstr = "cdrom://%s" % tree
- else:
- self.methodstr = methodstr
-
def write(self):
import network
self.writeXdriver()
--
1.7.11.4
11 years, 9 months
[PATCH 1/3] ksnet_to_dracut(): handle --mtu, cleanups
by Will Woods
Make parse-kickstart handle 'network --mtu=...' properly (now that
dracut supports it). Also generally clean up the handling of the "ip="
arg and correctly handle missing data for static ipv4.
---
dracut/parse-kickstart | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 55bc43a..851cecb 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -208,54 +208,54 @@ def find_devname(mac):
def ksnet_to_dracut(args, lineno, net, bootdev=False):
'''Translate the kickstart network data into dracut network data.'''
line = []
- ip=""
if is_mac(net.device): # this is a MAC - find the interface name
mac = net.device
net.device = find_devname(mac)
- if net.device is None: # iface not active - pick a name for it
+ if not net.device: # iface not active - pick a name for it
net.device = "ksdev0" # we only get called once, so this is OK
line.append("ifname=%s:%s" % (net.device, mac.lower()))
# NOTE: dracut currently only does ipv4 *or* ipv6, so only one ip=arg..
+ ip = ""
+ if not net.device:
+ net.device = ""
+ net.autoconf = "dhcp" # dracut's default
if net.bootProto in (BOOTPROTO_DHCP, BOOTPROTO_BOOTP):
- ip="dhcp"
+ net.autoconf = "dhcp"
elif net.bootProto == BOOTPROTO_IBFT:
- ip="ibft"
+ net.autoconf = "ibft"
elif net.bootProto == BOOTPROTO_QUERY:
log.error("'%s': --bootproto=query is deprecated", " ".join(args))
elif net.bootProto == BOOTPROTO_STATIC:
+ net.autoconf = "none"
+ ip = net.ip
req = ("gateway", "netmask", "nameserver", "ip")
- missing = ", ".join("--%s" % i for i in req if not hasattr(net, i))
+ missing = ", ".join("--%s" % i for i in req if not getattr(net, i, ""))
if missing:
log.warn("line %u: network missing %s", lineno, missing)
- else:
- ip="{0.ip}::{0.gateway}:{0.netmask}:" \
- "{0.hostname}:{0.device}:none".format(net)
elif net.ipv6 == "auto":
- ip="auto6"
+ net.autoconf = "auto6"
elif net.ipv6 == "dhcp":
- ip="dhcp6"
+ net.autoconf = "dhcp6"
elif net.ipv6:
- ip="[{0.ipv6}]::{0.gateway}:{0.netmask}:" \
- "{0.hostname}:{0.device}:none".format(net)
-
- if net.device and not ip.endswith(":none"):
- line.append("ip=%s:%s" % (net.device, ip))
+ net.autoconf = "none"
+ ip = "[%s]" % net.ipv6
+
+ # These argument forms are documented in dracut.kernel(7)
+ if net.autoconf == "none" or (net.mtu and not net.device):
+ ipstr = "ip={ip}::{net.gateway}:{net.netmask}:{net.hostname}:{net.device}:{net.autoconf}:{net.mtu}".format(ip=ip, net=net)
+ elif net.device:
+ ipstr = "ip={net.device}:{net.autoconf}:{net.mtu}".format(net=net)
else:
- line.append("ip=%s" % ip)
+ ipstr = "ip={net.autoconf}".format(net=net)
+
+ line.append(ipstr)
for ns in net.nameserver.split(","):
if ns:
line.append("nameserver=%s" % ns)
- if net.mtu:
- # XXX FIXME: dracut doesn't support mtu= (yet)
- if net.device:
- line.append("mtu=%s:%s" % (net.device, net.mtu))
- else:
- line.append("mtu=%s" % net.mtu)
-
# TODO: nodefroute, noipv[46], nodns: pass along to 'ifcfg' module somehow
# TODO FIXME dhcpclass: dracut only uses one dhclient.conf for all ifaces
# so we can't (yet) have per-interface dhcpclass
--
1.7.11.4
11 years, 9 months
[PATCH 1/2] Don't require hfs-tools on RHEL (#849987).
by Chris Lumens
---
anaconda.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 2c4a328..98bb73a 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -143,7 +143,9 @@ Requires: zenity
%endif
Requires: createrepo >= %{createrepover}
Requires: squashfs-tools
+%if ! 0%{?rhel}
Requires: hfsplus-tools
+%endif
Requires: genisoimage >= %{genisoimagever}
Requires: GConf2 >= %{gconfversion}
%ifarch %{ix86} x86_64
--
1.7.11.2
11 years, 9 months
[PATCH] Add yum-plugin-fastestmirror (#849797)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
---
share/runtime-install.tmpl | 3 +++
1 file changed, 3 insertions(+)
diff --git a/share/runtime-install.tmpl b/share/runtime-install.tmpl
index 868ac37..651871c 100644
--- a/share/runtime-install.tmpl
+++ b/share/runtime-install.tmpl
@@ -123,5 +123,8 @@ installpkg wget rsync rsh bind-utils ftp mtr vconfig
installpkg icfg spice-vdagent
installpkg gdisk
+## yum plugins
+yum-plugin-fastestmirror
+
## actually install all the requested packages
run_pkg_transaction
--
1.7.11.4
11 years, 9 months