[PATCH 3/3] Replace redundant ifs with direct assignments to the anaconda variables
Martin Kolman
mkolman at redhat.com
Wed Jun 18 12:24:07 UTC 2014
And also move the assignments to a common place.
Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
anaconda | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/anaconda b/anaconda
index 4d4cb0c..f29b24d 100755
--- a/anaconda
+++ b/anaconda
@@ -857,17 +857,12 @@ if __name__ == "__main__":
# Default is to prompt to mount the installed system.
anaconda.rescue_mount = not opts.rescue_nomount
- if opts.proxy:
- anaconda.proxy = opts.proxy
-
- if opts.updateSrc:
- anaconda.updateSrc = opts.updateSrc
-
- if opts.method:
- anaconda.methodstr = opts.method
-
- if opts.stage2:
- anaconda.stage2 = opts.stage2
+ # assign the other anaconda variables from options
+ anaconda.proxy = opts.proxy
+ anaconda.updateSrc = opts.updateSrc
+ anaconda.methodstr = opts.method
+ anaconda.stage2 = opts.stage2
+ anaconda.rescue = opts.rescue
if opts.liveinst:
from pyanaconda.screensaver import inhibit_screensaver
@@ -911,9 +906,6 @@ if __name__ == "__main__":
except OSError:
pass
- if opts.rescue:
- anaconda.rescue = True
-
log.info("anaconda called with cmdline = %s", sys.argv)
log.info("Default encoding = %s ", sys.getdefaultencoding())
--
1.9.3
More information about the anaconda-patches
mailing list