[master] Issues found when testing addon's TUI spoke
by Vratislav Podzimek
Two little tweaks.
Vratislav Podzimek (2):
Refresh addons_paths once we know if gui or tui takes place
Fix reprompting and screen redrawing on invalid input
pyanaconda/__init__.py | 12 +++++++++++-
pyanaconda/ui/tui/simpleline/base.py | 8 ++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
--
1.7.11.7
11 years, 2 months
[PATCH 1/2] Fixup kickstart script logging
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Changes to the execWith* methods removed the ability to handle a string
as stdin/out/err. Change the callers to first open where they want
output to be sent to and pass that instead.
Only stdout is needed because _run_program combines stdout and stderr,
pass stderr through but ignore it.
Also clean up a couple places that were passing strings that don't need
to.
---
anaconda | 3 +--
pyanaconda/iutil.py | 61 ++++++++++++++++++++++++++++++-------------------
pyanaconda/kickstart.py | 35 +++++++++++++---------------
pyanaconda/network.py | 3 +--
4 files changed, 55 insertions(+), 47 deletions(-)
diff --git a/anaconda b/anaconda
index 324d31e..06773ca 100755
--- a/anaconda
+++ b/anaconda
@@ -85,8 +85,7 @@ def startMetacityWM():
try:
args = ['--display', ':1',
'--sm-disable']
- iutil.execWithRedirect('metacity', args,
- stdout='/dev/null', stderr='/dev/null')
+ iutil.execWithRedirect('metacity', args)
except BaseException as e:
# catch all possible exceptions
log.error("Problems running the window manager: %s" % str(e))
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index dbc7c3b..2d2b08c 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -49,7 +49,15 @@ def augmentEnv():
})
return env
-def _run_program(argv, root='/', stdin=None, env_prune=None):
+def _run_program(argv, root='/', stdin=None, stdout=None, env_prune=None):
+ """ Run an external program, log the output and return it to the caller
+ @param argv The command to run and argument
+ @param root The directory to chroot to before running command.
+ @param stdin The file descriptor to read stdin from.
+ @param stdout Optional file descriptor to write stdout and stderr to.
+ @param env_prune environment variable to remove before execution
+ @return The return code of the command and the output
+ """
if env_prune is None:
env_prune = []
@@ -75,6 +83,8 @@ def _run_program(argv, root='/', stdin=None, env_prune=None):
if out:
for line in out.splitlines():
program_log.info(line)
+ if stdout:
+ stdout.write(line)
except OSError as e:
program_log.error("Error running %s: %s" % (argv[0], e.strerror))
@@ -84,41 +94,44 @@ def _run_program(argv, root='/', stdin=None, env_prune=None):
return (proc.returncode, out)
-## Run an external program and redirect the output to a file.
-# @param command The command to run.
-# @param argv A list of arguments.
-# @param stdin The file descriptor to read stdin from.
-# @param stdout The file descriptor to redirect stdout to.
-# @param stderr The file descriptor to redirect stderr to.
-# @param root The directory to chroot to before running command.
-# @return The return code of command.
-def execWithRedirect(command, argv, stdin = None, stdout = None,
- stderr = None, root = '/', env_prune=[]):
+def execWithRedirect(command, argv, stdin=None, stdout=None,
+ stderr=None, root='/', env_prune=[]):
+ """ Run an external program and redirect the output to a file.
+ @param command The command to run
+ @param argv The argument list
+ @param stdin The file descriptor to read stdin from.
+ @param stdout Optional file descriptor to redirect stdout and stderr to.
+ @param stderr not used
+ @param root The directory to chroot to before running command.
+ @param env_prune environment variable to remove before execution
+ @return The return code of the command
+ """
if flags.testing:
log.info("not running command because we're testing: %s %s"
% (command, " ".join(argv)))
return 0
argv = [command] + argv
- return _run_program(argv, stdin=stdin, root=root, env_prune=env_prune)[0]
-
-## Run an external program and capture standard out.
-# @param command The command to run.
-# @param argv A list of arguments.
-# @param stdin The file descriptor to read stdin from.
-# @param stderr The file descriptor to redirect stderr to.
-# @param root The directory to chroot to before running command.
-# @param fatal Boolean to determine if non-zero exit is fatal.
-# @return The output of command from stdout.
-def execWithCapture(command, argv, stdin = None, stderr = None, root='/',
- fatal = False):
+ return _run_program(argv, stdin=stdin, stdout=stdout, root=root, env_prune=env_prune)[0]
+
+def execWithCapture(command, argv, stdin=None, stderr=None, root='/',
+ fatal=False):
+ """ Run an external program and capture standard out and err.
+ @param command The command to run
+ @param argv The argument list
+ @param stdin The file descriptor to read stdin from.
+ @param stderr not used
+ @param root The directory to chroot to before running command.
+ @param fatal not used
+ @return The output of the command
+ """
if flags.testing:
log.info("not running command because we're testing: %s %s"
% (command, " ".join(argv)))
return ""
argv = [command] + argv
- return _run_program(argv, stdin=stdin, root=root)[1]
+ return _run_program(argv, stdin=stdin, stdout=stdout, root=root)[1]
## Run a shell.
def execConsole():
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index a93c552..35f90e2 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -81,7 +81,17 @@ packagesSeen = False
topology = None
class AnacondaKSScript(KSScript):
+ """ Execute a kickstart script
+
+ This will write the script to a file named /tmp/ks-script- before
+ execution.
+ Output is logged by the program logger, the path specified by --log
+ or to /tmp/ks-script-*.log
+ """
def run(self, chroot):
+ """ Run the kickstart script
+ @param chroot directory path to chroot into before execution
+ """
if self.inChroot:
scriptRoot = chroot
else:
@@ -93,9 +103,9 @@ class AnacondaKSScript(KSScript):
os.close(fd)
os.chmod(path, 0700)
- # Always log stdout/stderr from scripts. Using --logfile just lets you
+ # Always log stdout/stderr from scripts. Using --log just lets you
# pick where it goes. The script will also be logged to program.log
- # because of execWithRedirect, and to anaconda.log if the script fails.
+ # because of execWithRedirect.
if self.logfile:
if self.inChroot:
messages = "%s/%s" % (scriptRoot, self.logfile)
@@ -110,26 +120,13 @@ class AnacondaKSScript(KSScript):
# chroot later.
messages = "/tmp/%s.log" % os.path.basename(path)
- rc = iutil.execWithRedirect(self.interp, ["/tmp/%s" % os.path.basename(path)],
- stdin = messages, stdout = messages, stderr = messages,
- root = scriptRoot)
+ with open(messages, "w") as fp:
+ rc = iutil.execWithRedirect(self.interp, ["/tmp/%s" % os.path.basename(path)],
+ stdin=fp, stdout=fp,
+ root = scriptRoot)
- # Always log an error. Only fail if we have a handle on the
- # windowing system and the kickstart file included --erroronfail.
if rc != 0:
log.error("Error code %s running the kickstart script at line %s" % (rc, self.lineno))
-
- if os.path.isfile(messages):
- try:
- f = open(messages, "r")
- except IOError as e:
- err = None
- else:
- err = f.readlines()
- f.close()
- for l in err:
- log.error("\t%s" % l)
-
if self.errorOnFail:
errorHandler.cb(ScriptError(), self.lineno, err)
sys.exit(0)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 294f937..0d352d2 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -836,8 +836,7 @@ def set_hostname(hn):
return
log.info("setting installation environment hostname to %s" % hn)
- iutil.execWithRedirect("hostname", ["-v", hn ],
- stdout="/dev/tty5", stderr="/dev/tty5")
+ iutil.execWithRedirect("hostname", ["-v", hn ])
def get_NM_settings_value(iface, key1, key2):
value = ""
--
1.8.1
11 years, 2 months
[master] The LayoutIndicator widget and minor fixes
by Vratislav Podzimek
PATCH [3/3] is the most important one the other two are just fixes for
the issues I've noticed during the development and testing of the widget.
The preview of the widget and its functionality can be seen at:
http://vpodzime.fedorapeople.org/layout_indicator.webm
(it doesn't show that it has a tooltip with full layout name and description
of what clicking it does)
There are some questions related to the widget:
1) How it should look like? Should it have a border or some background?
2) How wide it should be? For now it is 8 chars wide and uses ELLIPSIZE_CENTER,
but it could be wider. I don't want it to be expanding because that would
result in many widgets changing their place and size when the layout is
switched. It could also be 2 chars wide and show just 'us', 'cz' etc., but
I believe some users are using e.g. 'cz' and 'cz (qwerty)' at the same time.
3) Where it should be placed? Should it go to the header of our BaseWindow
and to the dialogs that include password creation? Or should it be just
on the dialogs with password creation?
Suggestions?
Vratislav Podzimek (3):
Remove debugging print (DatetimeSpoke)
Fixes for the XklWrapper (#895766)
LayoutIndicator widget
pyanaconda/keyboard.py | 13 +-
pyanaconda/ui/gui/spokes/datetime_spoke.py | 1 -
widgets/configure.ac | 1 +
widgets/glade/AnacondaWidgets.xml | 7 +
widgets/src/LayoutIndicator.c | 339 +++++++++++++++++++++++++++++
widgets/src/LayoutIndicator.h | 69 ++++++
widgets/src/Makefile.am | 8 +-
7 files changed, 433 insertions(+), 5 deletions(-)
create mode 100644 widgets/src/LayoutIndicator.c
create mode 100644 widgets/src/LayoutIndicator.h
--
1.7.11.7
11 years, 2 months
[PATCH 1/2] Display storage warnings, similar to how errors are displayed (#909410).
by Chris Lumens
---
pyanaconda/ui/gui/spokes/storage.py | 56 ++++++++++++++++++++++++-------------
1 file changed, 36 insertions(+), 20 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index bb26754..7d4080e 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -440,6 +440,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
if self.autopart:
# this was already run as part of doAutoPartition. dumb.
StorageChecker.errors = []
+ StorageChecker.warnings = []
self.run()
finally:
self._ready = True
@@ -483,6 +484,8 @@ class StorageSpoke(NormalSpoke, StorageChecker):
if self.errors:
msg = _("Error checking storage configuration")
+ elif self.warnings:
+ msg = _("Warning checking storage configuration")
elif self.data.autopart.autopart:
msg = _("Automatic partitioning selected")
else:
@@ -530,6 +533,8 @@ class StorageSpoke(NormalSpoke, StorageChecker):
if self.errors:
self.set_warning(_("Error checking storage configuration. Click for details."))
+ elif self.warnings:
+ self.set_warning(_("Warning checking storage configuration. Click for details."))
def initialize(self):
from pyanaconda.ui.gui.utils import setViewportBackground
@@ -808,23 +813,34 @@ class StorageSpoke(NormalSpoke, StorageChecker):
print "ADD DISK CLICKED"
def on_info_bar_clicked(self, *args):
- if not self.errors:
- return
-
- label = _("The following errors were encountered when checking your storage "
- "configuration. You can modify your storage layout\nor quit the "
- "installer.")
- dialog = DetailedErrorDialog(self.data, buttons=[_("_Quit"), _("_Modify Storage Layout")], label=label)
- with enlightbox(self.window, dialog.window):
- errors = "\n".join(self.errors)
- dialog.refresh(errors)
- rc = dialog.run()
-
- dialog.window.destroy()
-
- if rc == 0:
- # Quit.
- sys.exit(0)
- elif rc == 1:
- # Close the dialog so the user can change selections.
- pass
+ if self.errors:
+ label = _("The following errors were encountered when checking your storage "
+ "configuration. You can modify your storage layout\nor quit the "
+ "installer.")
+
+ dialog = DetailedErrorDialog(self.data, buttons=[_("_Quit"), _("_Modify Storage Layout")], label=label)
+ with enlightbox(self.window, dialog.window):
+ errors = "\n".join(self.errors)
+ dialog.refresh(errors)
+ rc = dialog.run()
+
+ dialog.window.destroy()
+
+ if rc == 0:
+ # Quit.
+ sys.exit(0)
+ elif rc == 1:
+ # Close the dialog so the user can change selections.
+ pass
+ elif self.warnings:
+ label = _("The following warnings were encountered when checking your storage "
+ "configuration. These are not fatal, but you may wish to make "
+ "changes to your storage layout.")
+
+ dialog = DetailedErrorDialog(self.data, buttons=[_("_OK")], label=label)
+ with enlightbox(self.window, dialog.window):
+ warnings = "\n".join(self.warnings)
+ dialog.refresh(warnings)
+ rc = dialog.run()
+
+ dialog.window.destroy()
--
1.7.11.2
11 years, 2 months
[PATCH] Wait for continueButton in KS mode if the user changed anything
by Martin Sivak
This behaviour tries to minimize the "surprise factor" we have
in the installer. When the user entered spoke, changed any data
and then left the spoke, the installer gave him no chance for
review or correcting the entered values. With this patch applied
the Hub waits for a click on the continueButton if any user
interaction happened before all the spokes were ready+completed.
---
pyanaconda/ui/gui/hubs/__init__.py | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index 1379315..4056371 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -34,6 +34,7 @@ from pyanaconda.ui import common
from pyanaconda.ui.gui import GUIObject
from pyanaconda.ui.gui.categories import collect_categories
from pyanaconda.ui.gui.spokes import StandaloneSpoke, collect_spokes
+from pyanaconda.ui.gui.utils import gtk_call_once
import logging
log = logging.getLogger("anaconda")
@@ -85,7 +86,11 @@ class Hub(GUIObject, common.Hub):
GUIObject.__init__(self, data)
common.Hub.__init__(self, data, storage, payload, instclass)
- self._autoContinue = False
+ # enable the autoContinue feature if we are in kickstart
+ # mode, but if the user interacts with the hub, it will be
+ # disabled again
+ self._autoContinue = flags.automatedInstall
+
self._incompleteSpokes = []
self._inSpoke = False
self._notReadySpokes = []
@@ -330,9 +335,10 @@ class Hub(GUIObject, common.Hub):
if self.continuePossible:
if self._inSpoke:
- self._autoContinue = True
- elif q.empty():
- self.continueButton.emit("clicked")
+ self._autoContinue = False
+ elif self._autoContinue and q.empty():
+ # enqueue the emit to the Gtk message queue
+ gtk_call_once(self.continueButton.emit("clicked"))
elif code == communication.HUB_CODE_MESSAGE:
spoke.selector.set_property("status", args[1])
log.info("setting %s status to: %s" % (spoke, args[1]))
@@ -370,6 +376,15 @@ class Hub(GUIObject, common.Hub):
if selector:
selector.grab_focus()
+ # On automated kickstart installs, our desired behavior is to display
+ # the hub while background processes work, then skip to the progress
+ # hub immediately after everything's done.
+ # However if the user proves his intent to change the kickstarted
+ # values by entering any of the spokes, we need to disable the
+ # autoContinue feature and wait for the user to explicitly state
+ # that he is done configuring by pressing the continue button.
+ self._autoContinue = False
+
self._inSpoke = True
self._runSpoke(spoke)
self._inSpoke = False
@@ -389,10 +404,4 @@ class Hub(GUIObject, common.Hub):
self._on_spoke_clicked(self._spokes[dest].selector, None, self._spokes[dest])
- # On automated kickstart installs, our desired behavior is to display
- # the hub while background processes work, then skip to the progress
- # hub immediately after everything's done. However, this allows for
- # the possibility that the user will be on a hub when everything
- # finishes. We need to wait until they're done, and then continue.
- if self._autoContinue:
- self.continueButton.emit("clicked")
+
--
1.7.11.7
11 years, 2 months
[PATCH 1/3] Get rid of packagesSeen.
by Chris Lumens
pykickstart now provides this information for all commands.
---
anaconda.spec.in | 2 +-
pyanaconda/kickstart.py | 4 ----
pyanaconda/ui/gui/spokes/software.py | 7 +++----
3 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 755c8a5..5bb3b74 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -23,7 +23,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%define gconfversion 2.28.1
%define intltoolver 0.31.2-3
%define libnlver 1.0
-%define pykickstartver 1.99.22
+%define pykickstartver 1.99.24
%define yumver 3.4.3-32
%define partedver 1.8.1
%define pypartedver 2.5-2
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index c2249f6..f6bf222 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -74,8 +74,6 @@ stdoutLog = logging.getLogger("anaconda.stdout")
from anaconda_log import logger, logLevelMap, setHandlersLevel,\
DEFAULT_TTY_LEVEL
-packagesSeen = False
-
# deviceMatches is called early, before any multipaths can possibly be coalesced
# so it needs to know about them in some additional way: have the topology ready.
topology = None
@@ -1484,8 +1482,6 @@ def parseKickstart(f):
errorHandler.cb(KickstartError(), e)
sys.exit(1)
- global packagesSeen
- packagesSeen = ksparser.getSection("%packages").timesSeen > 0
return handler
def appendPostScripts(ksdata):
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 8598303..3493d0c 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -24,7 +24,6 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
N_ = lambda x: x
from pyanaconda.flags import flags
-from pyanaconda.kickstart import packagesSeen
from pyanaconda.threads import threadMgr, AnacondaThread
from pyanaconda.ui import communication
@@ -124,7 +123,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
processingDone = not threadMgr.get("AnaCheckSoftwareThread") and \
not self._errorMsgs and self.txid_valid
- if flags.automatedInstall and packagesSeen:
+ if flags.automatedInstall and self.data.packages.seen:
return processingDone
else:
return self._get_selected_environment() is not None and processingDone
@@ -164,7 +163,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
# Kickstart installs with %packages will have a row selected, unless
# they did an install without a desktop environment. This should
# catch that one case.
- if flags.automatedInstall and packagesSeen:
+ if flags.automatedInstall and self.data.packages.seen:
return _("Custom software selected")
return _("Nothing selected")
@@ -184,7 +183,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
# we have no way to select environments with kickstart right now
# so don't try.
- if flags.automatedInstall and packagesSeen:
+ if flags.automatedInstall and self.data.packages.seen:
# We don't want to do a full refresh, just
# join the metadata thread
threadMgr.wait("AnaPayloadMDThread")
--
1.7.11.2
11 years, 2 months
[PATCH] Move the encryption checkbox to the dialog
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
This moves the 'Encrypt my data' checkbox from the main storage spoke
into the dialog above the partition type combobox.
---
pyanaconda/ui/gui/spokes/storage.glade | 68 +++++++++++++++++++---------------
pyanaconda/ui/gui/spokes/storage.py | 30 ++++++++++-----
2 files changed, 58 insertions(+), 40 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.glade b/pyanaconda/ui/gui/spokes/storage.glade
index 114d4d2..24a0737 100644
--- a/pyanaconda/ui/gui/spokes/storage.glade
+++ b/pyanaconda/ui/gui/spokes/storage.glade
@@ -158,6 +158,24 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="encryption1_checkbutton">
+ <property name="label" translatable="yes">_Encrypt my data. I'll set a passphrase later.</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="hexpand">True</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_encrypt_toggled" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkExpander" id="options1_expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -215,7 +233,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>
@@ -456,6 +474,24 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="encryption2_checkbutton">
+ <property name="label" translatable="yes">_Encrypt my data. I'll set a passphrase later.</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="hexpand">True</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_encrypt_toggled" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkExpander" id="options2_expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -513,7 +549,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
@@ -793,8 +829,6 @@
<property name="vexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
<child internal-child="action_area">
<object class="GtkBox" id="storageWindow-action_area1">
<property name="can_focus">False</property>
@@ -946,32 +980,6 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="encryption_checkbutton">
- <property name="label" translatable="yes">_Encrypt my data. I'll set a passphrase later.</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">end</property>
- <property name="valign">end</property>
- <property name="hexpand">True</property>
- <property name="use_underline">True</property>
- <property name="xalign">1</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
<placeholder/>
</child>
</object>
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index a3d31ff..6d53bb4 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -147,11 +147,15 @@ class InstallOptions1Dialog(GUIObject):
self.window.destroy()
return rc
- def refresh(self, required_space, disk_free, fs_free, autoPartType):
+ def refresh(self, required_space, disk_free, fs_free, autoPartType, encrypted):
self.autoPartType = autoPartType
self.autoPartTypeCombo = self.builder.get_object("options1_combo")
self.autoPartTypeCombo.set_active(self.autoPartType)
+ self.encrypted = encrypted
+ self.encryptCheckbutton = self.builder.get_object("encryption1_checkbutton")
+ self.encryptCheckbutton.set_active(self.encrypted)
+
options_label = self.builder.get_object("options1_label")
options_text = _("You have <b>%(freeSpace)s</b> of free space, which is "
@@ -241,15 +245,22 @@ class InstallOptions1Dialog(GUIObject):
def on_type_changed(self, combo):
self.autoPartType = combo.get_active()
+ def on_encrypt_toggled(self, checkbox):
+ self.encrypted = checkbox.get_active()
+
class InstallOptions2Dialog(InstallOptions1Dialog):
builderObjects = ["options2_dialog"]
mainWidgetName = "options2_dialog"
- def refresh(self, required_space, disk_free, fs_free, autoPartType):
+ def refresh(self, required_space, disk_free, fs_free, autoPartType, encrypted):
self.autoPartType = autoPartType
self.autoPartTypeCombo = self.builder.get_object("options2_combo")
self.autoPartTypeCombo.set_active(self.autoPartType)
+ self.encrypted = encrypted
+ self.encryptCheckbutton = self.builder.get_object("encryption2_checkbutton")
+ self.encryptCheckbutton.set_active(self.encrypted)
+
sw_text = self._get_sw_needs_text(required_space)
label_text = _("%s\nThe disks you've selected have the following "
"amounts of free space:") % sw_text
@@ -279,7 +290,7 @@ class InstallOptions3Dialog(InstallOptions1Dialog):
builderObjects = ["options3_dialog"]
mainWidgetName = "options3_dialog"
- def refresh(self, required_space, disk_free, fs_free, autoPartType):
+ def refresh(self, required_space, disk_free, fs_free, autoPartType, encrypted):
sw_text = self._get_sw_needs_text(required_space)
label_text = (_("%s\nYou don't have enough space available to install "
"<b>%s</b>, even if you used all of the free space\n"
@@ -501,9 +512,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self._previous_autopart = self.autopart
- encrypt_checkbutton = self.builder.get_object("encryption_checkbutton")
- encrypt_checkbutton.set_active(self.encrypted)
-
# update the selections in the ui
overviews = self.local_disks_box.get_children()
for overview in overviews:
@@ -658,9 +666,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
def _check_encrypted(self):
# even if they're not doing autopart, setting autopart.encrypted
# establishes a default of encrypting new devices
- encrypt_button = self.builder.get_object("encryption_checkbutton")
- self.encrypted = encrypt_button.get_active()
-
if not self.encrypted:
return True
@@ -733,10 +738,12 @@ class StorageSpoke(NormalSpoke, StorageChecker):
else:
dialog = InstallOptions3Dialog(self.data, payload=self.payload)
- dialog.refresh(required_space, disk_free, fs_free, self.autoPartType)
+ dialog.refresh(required_space, disk_free, fs_free, self.autoPartType,
+ self.encrypted)
rc = self.run_lightbox_dialog(dialog)
if rc == dialog.RESPONSE_CONTINUE:
self.autoPartType = dialog.autoPartType
+ self.encrypted = dialog.encrypted
if not self._check_encrypted():
return
@@ -761,6 +768,8 @@ class StorageSpoke(NormalSpoke, StorageChecker):
NormalSpoke.on_back_clicked(self, button)
elif rc == dialog.RESPONSE_RECLAIM:
self.autoPartType = dialog.autoPartType
+ self.encrypted = dialog.encrypted
+
if not self._check_encrypted():
return
@@ -771,6 +780,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
elif rc == dialog.RESPONSE_CUSTOM:
self.autopart = False
self.autoPartType = dialog.autoPartType
+ self.encrypted = dialog.encrypted
self.skipTo = "CustomPartitioningSpoke"
NormalSpoke.on_back_clicked(self, button)
--
1.8.1
11 years, 2 months
[PATCH rhel7] Set ONBOOT=no for default autoconnections (#905918, #886090)
by Radek Vykydal
Autoconnections are set up by NM for devices not having ifcfg file
(ie those not activated by dracut or not configured in kickstart).
We want to default to "no" for this devices in RHEL.
We even't don't want to bring up the autoconnections in installer
environment, but that is something for a separate bug.
---
pyanaconda/network.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 2bf7832..dc29c1b1 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -483,6 +483,7 @@ def createMissingDefaultIfcfgs():
# if so, write its configuration with name changed to iface
if con_hwaddr.upper() == hwaddr.upper():
setting['connection']['id'] = interface
+ setting['connection']['autoconnect'] = False
con.Update(setting)
rv = True
log.debug("network: dumped ifcfg file for default autoconnection on %s" % interface)
--
1.7.11.7
11 years, 2 months
[PATCH] re-fetch metadata when proxy settings change
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
If you entered a bad proxy the only way to get it to continue was to
change the source to something different.
---
pyanaconda/ui/gui/spokes/source.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 87ebb89..b5a7162 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -95,8 +95,6 @@ class ProxyDialog(GUIObject):
self._proxyAuthBox.set_sensitive(button.get_active())
def refresh(self):
- import re
-
GUIObject.refresh(self)
self._proxyCheck = self.builder.get_object("enableProxyCheck")
@@ -435,6 +433,7 @@ class SourceSpoke(NormalSpoke):
self._currentIsoFile = None
self._ready = False
self._error = False
+ self._proxyChange = False
def apply(self):
import copy
@@ -475,7 +474,8 @@ class SourceSpoke(NormalSpoke):
elif self._mirror_active():
# this preserves the url for later editing
self.data.method.method = None
- if not old_source.method and self.payload.baseRepo:
+ if not old_source.method and self.payload.baseRepo and \
+ not self._proxyChange:
return
elif self._http_active() or self._ftp_active():
url = self._urlEntry.get_text().strip()
@@ -499,7 +499,7 @@ class SourceSpoke(NormalSpoke):
url = "https://" + url
mirrorlist = self._mirrorlistCheckbox.get_active()
- if old_source.method == "url" and \
+ if old_source.method == "url" and not self._proxyChange and \
((not mirrorlist and old_source.url == url) or \
(mirrorlist and old_source.mirrorlist == url)):
return
@@ -879,10 +879,12 @@ class SourceSpoke(NormalSpoke):
self._verifyIsoButton.set_sensitive(True)
def on_proxy_clicked(self, button):
+ old_proxy = self.data.method.proxy
dialog = ProxyDialog(self.data)
with enlightbox(self.window, dialog.window):
dialog.refresh()
dialog.run()
+ self._proxyChange = old_proxy != self.data.method.proxy
def on_verify_iso_clicked(self, button):
p = self._get_selected_partition()
--
1.8.1
11 years, 2 months