[PATCH] read flags using filename globs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From: "Brian C. Lane" <bcl@xxxxxxxxxx>

read flags from all the conf files in /run/initramfs/etc/cmdline.d/
And add support for filename globs to the read() method
 pyanaconda/ |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/ b/pyanaconda/
index ad67a0a..5728ef2 100644
--- a/pyanaconda/
+++ b/pyanaconda/
@@ -20,6 +20,7 @@
 import os
 import selinux
 import shlex
+import glob
 from constants import *
 from collections import OrderedDict
@@ -88,7 +89,7 @@ class Flags(object):
             self.nogpt = True
 cmdline_files = ['/proc/cmdline', '/run/initramfs/etc/cmdline',
-                 '/run/initramfs/etc/cmdline.d/80kickstart.conf', '/etc/cmdline']
+                 '/run/initramfs/etc/cmdline.d/*.conf', '/etc/cmdline']
 class BootArgs(OrderedDict):
     Hold boot arguments as an OrderedDict.
@@ -109,10 +110,15 @@ class BootArgs(OrderedDict):
         Read and parse a filename (or a list of filenames).
         Files that can't be read are silently ignored.
         Returns a list of successfully read files.
+        filenames can contain *, ?, and character ranges expressed with []
         readfiles = []
         if type(filenames) == str:
             filenames = [filenames]
+        # Expand any filename globs
+        filenames = [f for g in filenames for f in glob.glob(g)]
         for f in filenames:

Anaconda-devel-list mailing list

[Home]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Red Hat 9 Bible]     [Fedora Bible]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

Powered by Linux