[master 21/30] Update parse-kickstart for python3 (#1014220)
M4rtinK
installerbot-noreply at redhat.com
Mon Jun 1 14:04:38 UTC 2015
From: "Brian C. Lane" <bcl at redhat.com>
Also Drop the unicode (c) from parse-kickstart
It causes modulefinder to choke when reading the file. Arguably a bug
with modulefinder, but it solves things for now.
---
dracut/parse-kickstart | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 5f6e4bb..86aa17f 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python3
#vim: set fileencoding=utf8
# parse-kickstart - read a kickstart file and emit equivalent dracut boot args
#
@@ -6,7 +6,7 @@
# Requires python 2.7 or later.
#
#
-# Copyright © 2012-2014 Red Hat, Inc.
+# Copyright (C) 2012-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
@@ -552,7 +552,7 @@ def write_ifcfg(filename, ifcfg):
try:
with open(filename, "w") as f:
f.write('# Generated by parse-kickstart\n')
- for k,v in sorted(ifcfg.items()):
+ for k,v in list(ifcfg.items()):
f.write("%s=%s\n" % (k,v))
except IOError as e:
log.error("can't write %s: %s", filename, e)
@@ -591,5 +591,5 @@ if __name__ == '__main__':
for path in sys.argv[1:]:
outfile, output = process_kickstart(path)
- for line in filter(None, output):
+ for line in (l for l in output if l):
print(line)
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/289d0c07eeab7a785cf7c93e319b65379201041c
More information about the anaconda-patches
mailing list