[PATCH] fix crash with bare 'inst.virtiolog' in boot args

Will Woods wwoods at redhat.com
Mon Mar 16 15:50:42 UTC 2015


For most boot arguments (e.g. "inst.ks=/some/path"), we'll have
`flags.cmdline[ks] == "/some/path"`.

For *bare* boot arguments, the value will be None.

So, if you do:

    vport = flags.cmdline.get("virtiolog", self.VIRTIO_PORT)

but the boot args have a bare 'inst.virtiolog', vport will be None
instead of self.VIRTIO_PORT.

So: just do a plain get(), and if the result is None or an empty string,
use self.VIRTIO_PORT instead.
---
 pyanaconda/anaconda_log.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
index 3e8d70b..7012167 100644
--- a/pyanaconda/anaconda_log.py
+++ b/pyanaconda/anaconda_log.py
@@ -236,7 +236,7 @@ class AnacondaLog:
         """
         TEMPLATE = "*.* %s;anaconda_syslog\n"
 
-        vport = flags.cmdline.get('virtiolog', self.VIRTIO_PORT)
+        vport = flags.cmdline.get('virtiolog') or self.VIRTIO_PORT
 
         if not os.access(vport, os.W_OK):
             return
-- 
2.1.0



More information about the anaconda-patches mailing list