[pykickstart] [PATCH] Beware of possibly unicode strings (#876293)
by Vratislav Podzimek
__str__ method should return byte string, not unicode string. But
as we don't have a check in every KS_OBJECT.__str__ method, let's at
least add try-except block to prevent UnicodeDecodeError tracebacks.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pykickstart/base.py | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/pykickstart/base.py b/pykickstart/base.py
index 4ef442c..9079906 100644
--- a/pykickstart/base.py
+++ b/pykickstart/base.py
@@ -281,12 +281,20 @@ class BaseHandler(KickstartObject):
for prio in lst:
for obj in self._writeOrder[prio]:
- retval += obj.__str__()
+ obj_str = str(obj)
+ try:
+ retval += obj_str
+ except UnicodeDecodeError:
+ retval += obj_str.encode("utf-8")
for script in self.scripts:
- retval += script.__str__()
+ script_str = str(script)
+ try:
+ retval += script_str
+ except UnicodeDecodeError:
+ retval += script_str.encode("utf-8")
- retval += self.packages.__str__()
+ retval += str(self.packages)
return retval
--
1.7.11.7
11 years, 3 months
[master] Checkbutton for language-default layout only
by Vratislav Podzimek
This patch adds checkbutton as was suggested in the bugzilla discussion.
The result can be seen at [1]. I know the text is quite small, but I didn't
find ay way how to set attributes of the checkbutton's label. We could
either leave it as it is or use checkbutton with no label, add new label
next to it and wire click events on the label to checkbutton toggling.
[1] http://vpodzime.fedorapeople.org/welcome_spoke_new_checkbutton.png
Vratislav Podzimek (1):
Add checkbox for setting language default layout (#866887)
pyanaconda/ui/gui/spokes/welcome.glade | 17 ++++++++++++++
pyanaconda/ui/gui/spokes/welcome.py | 41 +++++++++++++++++++++++-----------
2 files changed, 45 insertions(+), 13 deletions(-)
--
1.7.11.7
11 years, 3 months
[PATCH] anaconda realm command
by Stef Walter
This patch adds the realm command to anaconda. It depends on the
pykickstart changes I added earlier (hmmm, how should I reflect this
dependency?).
Again, the big use case is automatic AD domain joins by adding a
line to a kickstart file. The line in the kickstart file looks like:
realm join domain.example.com
or:
realm join --one-time-password=mypassword domain.example.com
Attached are two patches. The first one sets the kernel hostname during
the post install, so it can be used by stuff running in the chroot.
realmd needs the hostname to be appropriately set.
The second patch adds the realm command implementation. It does this:
* Early in the install the realm is discovered. This tells us what
kind of realm (such as AD domain vs. IPA domain etc.) and what
kind of packages need to be installed to support it. The required
packages are added to the install.
* After the install and configuration, we join the realm using the
realmd. realmd has support for running within a chroot, and without
a dbus system bus etc. So we use this to run within /mnt/sysimage.
Happy to adapt this as necessary. Looking forward to review.
Cheers,
Stef
11 years, 3 months
[PATCH] pykickstart realm support
by Stef Walter
I've been working on more tight integration between realmd and
kickstart. The big use case is automatic AD domain joins by adding a
line to a kickstart file.
The line in the kickstart file looks like:
realm join domain.example.com
realm join --one-time-password domain.example.com
Attached is the first set of patches to pykickstart which implements
support for the realm command.
I'd like to see this feature make it into RHEL7. As I understand it that
would mean inclusion in Fedora 19 and backporting to RHEL 7. I'm happy
to help with that, and I don't mean to just drop this off in your guys
lap :)
So attached are two patches. One which adds support for Fedora 19 to
pykickstart. I hope I've done this right. I'm pretty new to this. The
other patch adds the realm command, and tests.
Will follow with anaconda patches, which make the implementation
clearer. The basic procedure is: a) discover realm before install and
add needed packages b) after install and configuration, join realm.
Should I file RH bugzilla bugs to track this? Happy to do this
differently if necessary.
Cheers,
Stef
11 years, 3 months
i18n patches
by Chris Lumens
The following pile of patches fixes up most of the translation issues
throughout anaconda, basically for bug 858628. I've not applied that number
to any individual fix as it's hard to really tell what should get the
bug.
The following things still are not translated:
- Cancel and Add buttons on the keyboard's add dialog.
- Close button on the keyboard's layout dialog.
- Remove and Close buttons on the disk shopping cart.
- Cancel button on the reclaim dialog.
- Root names on the custom partitioning's LHS.
- All of the select ISO dialog.
- All of python-meh, except for the Quit button.
Anyone want to take a look at those?
- Chris
11 years, 3 months
[PATCH] Get rid of the unneeded action1.
by Chris Lumens
This is just causing assertions on tty1.
---
pyanaconda/ui/gui/spokes/custom.glade | 4 ----
1 file changed, 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade
index 70ec694..3b72856 100644
--- a/pyanaconda/ui/gui/spokes/custom.glade
+++ b/pyanaconda/ui/gui/spokes/custom.glade
@@ -2,7 +2,6 @@
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-requires AnacondaWidgets 1.0 -->
- <object class="GtkAction" id="action1"/>
<object class="GtkDialog" id="addDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
@@ -1441,7 +1440,6 @@ you'll be able to view their details here.</property>
<child>
<object class="GtkToolButton" id="addButton">
<property name="use_action_appearance">False</property>
- <property name="related_action">action1</property>
<property name="width_request">42</property>
<property name="height_request">36</property>
<property name="visible">True</property>
@@ -1460,7 +1458,6 @@ you'll be able to view their details here.</property>
<child>
<object class="GtkToolButton" id="removeButton">
<property name="use_action_appearance">False</property>
- <property name="related_action">action1</property>
<property name="width_request">42</property>
<property name="height_request">36</property>
<property name="visible">True</property>
@@ -1479,7 +1476,6 @@ you'll be able to view their details here.</property>
<child>
<object class="GtkToolButton" id="configureButton">
<property name="use_action_appearance">False</property>
- <property name="related_action">action1</property>
<property name="width_request">42</property>
<property name="height_request">36</property>
<property name="visible">True</property>
--
1.7.11.2
11 years, 3 months
[PATCH] Correct doing string substitution for encryption.
by Chris Lumens
---
pyanaconda/ui/gui/spokes/lib/passphrase.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/passphrase.py b/pyanaconda/ui/gui/spokes/lib/passphrase.py
index 63be728..ecf2484 100644
--- a/pyanaconda/ui/gui/spokes/lib/passphrase.py
+++ b/pyanaconda/ui/gui/spokes/lib/passphrase.py
@@ -81,8 +81,8 @@ class PassphraseDialog(GUIObject):
# update the warning label with the currently selected keymap
xkl_wrapper = keyboard.XklWrapper.get_instance()
keymap_name = xkl_wrapper.get_current_layout_name()
- warning_label_text = warning_label_template % keymap_name
- self._warning_label.set_markup(_(warning_label_text))
+ warning_label_text = _(warning_label_template) % keymap_name
+ self._warning_label.set_markup(warning_label_text)
# initialize with the previously set passphrase
self.passphrase = self.data.autopart.passphrase
@@ -147,9 +147,9 @@ class PassphraseDialog(GUIObject):
sensitive = True
if self._pwq_error:
icon = "gtk-dialog-error"
- msg = ERROR_WEAK % self._pwq_error
+ msg = _(ERROR_WEAK) % self._pwq_error
sensitive = False
- self._set_entry_icon(entry, icon, _(msg))
+ self._set_entry_icon(entry, icon, msg)
self._confirm_entry.set_sensitive(sensitive)
if sensitive:
--
1.7.11.2
11 years, 3 months
[master] fixes for PkgWrangler review
by David Cantrell
In an effort to learn how the new PkgWrangler works, I've been working
through the anaconda review. Here are fixes for that along with some
other things:
1) systemd and udev stuff installing to /usr/lib rather than /lib. I
can't use the %{_libdir} macro because the 64-bit platforms give us
/usr/lib64, so I went with %{_prefix}/lib. If there is a special
macro I should be using here, let me know.
2) Drop newt-devel and slang-devel BuildRequires. Loader is gone, we
don't need these anymore.
--
David Cantrell <david.l.cantrell(a)gmail.com>
WH6DSN | http://blog.burdell.org/
11 years, 4 months
[master] Layout testing area label change
by Vratislav Podzimek
This fixes the label above the text area for testing layout configuration.
While this is a stupid bug that should be fixed for F18 it would brake
translations. Suggestions?
Vratislav Podzimek (1):
Change testing area label to something more appropriate
(KeyboardSpoke)
pyanaconda/ui/gui/spokes/keyboard.glade | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
1.7.11.7
11 years, 4 months
[PATCH master] Remove resetResolver function, we don't need it anymore (#868695)
by Radek Vykydal
Also removes urlgrabber.grabber.reset_curl_obj() from getDefaultHostname()
where all its job were to cause races occasionally.
---
pyanaconda/isys/isys.c | 14 --------------
pyanaconda/network.py | 5 -----
pyanaconda/textw/netconfig_text.py | 1 -
3 files changed, 20 deletions(-)
diff --git a/pyanaconda/isys/isys.c b/pyanaconda/isys/isys.c
index d2411f5..c3f2183 100644
--- a/pyanaconda/isys/isys.c
+++ b/pyanaconda/isys/isys.c
@@ -91,7 +91,6 @@ static PyObject * doSwapoff(PyObject * s, PyObject * args);
static PyObject * doWipeRaidSuperblock(PyObject * s, PyObject * args);
static PyObject * doGetRaidChunkSize(PyObject * s, PyObject * args);
static PyObject * doDevSpaceFree(PyObject * s, PyObject * args);
-static PyObject * doResetResolv(PyObject * s, PyObject * args);
static PyObject * doExt2Dirty(PyObject * s, PyObject * args);
static PyObject * doExt2HasJournal(PyObject * s, PyObject * args);
static PyObject * doEjectCdrom(PyObject * s, PyObject * args);
@@ -120,7 +119,6 @@ static PyMethodDef isysModuleMethods[] = {
{ "getraidchunk", (PyCFunction) doGetRaidChunkSize, METH_VARARGS, NULL },
{ "mount", (PyCFunction) doMount, METH_VARARGS, NULL },
{ "umount", (PyCFunction) doUMount, METH_VARARGS, NULL },
- { "resetresolv", (PyCFunction) doResetResolv, METH_VARARGS, NULL },
{ "swapon", (PyCFunction) doSwapon, METH_VARARGS, NULL },
{ "swapoff", (PyCFunction) doSwapoff, METH_VARARGS, NULL },
{ "isPseudoTTY", (PyCFunction) doisPseudoTTY, METH_VARARGS, NULL},
@@ -275,18 +273,6 @@ static PyObject * doPrefixToNetmask (PyObject * s, PyObject * args) {
return Py_BuildValue("s", dst);
}
-static PyObject * doResetResolv(PyObject * s, PyObject * args) {
- if (!PyArg_ParseTuple(args, "")) {
- return NULL;
- }
-
- /* reinit the resolver so DNS changes take affect */
- res_init();
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
static PyObject * doWipeRaidSuperblock(PyObject * s, PyObject * args) {
int fd;
unsigned long size;
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 640cd70..d626ea1 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -115,7 +115,6 @@ def getFirstRealIP():
# Try to determine what the hostname should be for this system
def getHostname():
- resetResolver()
hn = None
@@ -700,10 +699,6 @@ def ifaceForHostIP(host):
return routeInfo[routeInfo.index("dev") + 1]
-def resetResolver():
- isys.resetResolv()
- urlgrabber.grabber.reset_curl_obj()
-
def setHostname(hn):
if flags.imageInstall:
log.info("image install -- not setting hostname")
diff --git a/pyanaconda/textw/netconfig_text.py b/pyanaconda/textw/netconfig_text.py
index 47db652..daa7329 100644
--- a/pyanaconda/textw/netconfig_text.py
+++ b/pyanaconda/textw/netconfig_text.py
@@ -406,7 +406,6 @@ class NetworkConfiguratorText:
dev.writeIfcfgFile()
return False
- network.resetResolver()
return True
def _ipv4MethodToggled(self, *args):
--
1.7.11.7
11 years, 4 months