[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/flags.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py
index ad67a0a..5728ef2 100644
--- a/pyanaconda/flags.py
+++ b/pyanaconda/flags.py
@@ -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:
             try:
                 self.readstr(open(f).read())
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux