[PATCH pykickstart] Add network --ipv6gateway option (#905226)
by Radek Vykydal
---
pykickstart/commands/network.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pykickstart/commands/network.py b/pykickstart/commands/network.py
index fd7463b..6f50ac1 100644
--- a/pykickstart/commands/network.py
+++ b/pykickstart/commands/network.py
@@ -177,6 +177,7 @@ class F19_NetworkData(F16_NetworkData):
self.bondslaves = kwargs.get("bondslaves", "")
self.bondopts = kwargs.get("bondopts", "")
self.vlanid = kwargs.get("vlanid", "")
+ self.ipv6gateway = kwargs.get("ipv6gateway", "")
def _getArgsAsStr(self):
retval = F16_NetworkData._getArgsAsStr(self)
@@ -187,6 +188,8 @@ class F19_NetworkData(F16_NetworkData):
retval += " --bondopts=%s" % self.bondopts
if self.vlanid:
retval += " --vlanid %s" % self.vlanid
+ if self.ipv6gateway:
+ retval += " --ipv6gateway %s" % self.ipv6gateway
return retval
@@ -377,6 +380,8 @@ class F19_Network(F18_Network):
op.add_option("--bondopts", dest="bondopts", action="store",
default="")
op.add_option("--vlanid", dest="vlanid")
+ op.add_option("--ipv6gateway", dest="ipv6gateway", action="store",
+ default="")
return op
class RHEL4_Network(FC3_Network):
--
1.7.11.7
11 years, 2 months
[master] Exception handling related patches
by Vratislav Podzimek
These are patches that fix and enhance behaviour of exception handling
in some specific cases.
PATCH 1/3 adds the code that moves exception handling in text mode to the main
thread even if an exception appears in a non-main thread. This is needed for
various reasons and it is implemented using the asynchronous message handling in
text mode. The basic idea is described in the commit message. And it needs a
patch for python-meh that is being proposed so that we can tell python-meh to
use our raw_input instead of the standard one that doesn't work with threads.
PATCH 2/3 only adds some logging that becomes really handy in case exception
handling doesn't work as expected.
PATCH 3/3 fixes the issue with the rescue mode. It adds some needed pieces to
the RescueInterface, moves the creation of its instance to a better place and
adds a class for exception handling interface correclty shutting down snack
before running the exception handler.
Vratislav Podzimek (3):
Run exception handling in the main thread also in TUI
Add logging to exception handling
Make exception handling in the rescue mode work
anaconda | 8 ++--
pyanaconda/exception.py | 85 ++++++++++++++++++++++++++----------
pyanaconda/rescue.py | 25 +++++++++--
pyanaconda/ui/tui/__init__.py | 27 +++++++++++-
pyanaconda/ui/tui/simpleline/base.py | 36 +++++++++++----
5 files changed, 141 insertions(+), 40 deletions(-)
--
1.7.11.7
11 years, 2 months
[master] Save our DBus world (possible Alpha blocker fix)
by Vratislav Podzimek
Three patches with one goal -- fix the problem with Anaconda segfaulting at the
end of the installation (Configuring installed system) as described in the bug
#928287 and its duplicates).
PATCH 1/3 just creates a constant for magic value used as DBus timeout.
PATCH 2/3 adds a module with thread and main loop safe operations with DBus. It
may seem as a lot of code, but is really just a few lines of code and a lot of
docstring lines. I've tested if it fixes the segfault and it works for me. Other
people CC'ed in the bug #928287 will hopefully test it too with the updates.img
I've provided.
PATCH 3/3 modifies the LocaledWrapper to use the new module because it was
LocaledWrapper causing the segfaults (indirectly).
I'm afraid we may step into the same sh*t again with the code in nm.py, but I
try to be optimistic and don't modify the code there in the same way for now.
Vratislav Podzimek (3):
Define a DEFAULT_DBUS_TIMEOUT constant and use it
Add module providing safe DBus operations
Modify LocaledWrapper to use our safe_dbus module (#928287)
pyanaconda/constants.py | 3 ++
pyanaconda/keyboard.py | 96 ++++++++++++++++++------------------
pyanaconda/nm.py | 16 +++---
pyanaconda/safe_dbus.py | 126 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 186 insertions(+), 55 deletions(-)
create mode 100644 pyanaconda/safe_dbus.py
--
1.7.11.7
11 years, 2 months
[PATCH] Correctly report an error if OSError is hit when setting up the source (#947634).
by Chris Lumens
---
pyanaconda/ui/gui/spokes/source.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index f7a2103..0a47679 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -416,7 +416,7 @@ class SourceSpoke(NormalSpoke):
time.sleep(1)
try:
self.payload.updateBaseRepo(fallback=False, checkmount=False)
- except PayloadError as e:
+ except (OSError, PayloadError) as e:
log.error("PayloadError: %s" % (e,))
self._error = True
hubQ.send_message(self.__class__.__name__, _("Failed to set up installation source"))
--
1.8.1.2
11 years, 2 months
[PATCH 1/3] Add execReadlines utility
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Add a function to read the output from an executable and act on it in
real time. It uses a Thread and a Queue to process the command's stdout
without blocking and yield's the lines back to the caller so that it can
be used like this:
for line in execReadlines("command", [args]):
print line
---
pyanaconda/iutil.py | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 66 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index 1f75ad9..d2a02e0 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -21,15 +21,15 @@
#
import glob
-import os, string, stat, sys
-import shutil
-import signal
+import os
+import stat
import os.path
import errno
import subprocess
-import threading
import re
import unicodedata
+from threading import Thread
+from Queue import Queue, Empty
from flags import flags
from constants import *
@@ -134,6 +134,68 @@ def execWithCapture(command, argv, stdin=None, stderr=None, root='/',
argv = [command] + argv
return _run_program(argv, stdin=stdin, root=root)[1]
+def execReadlines(command, argv, stdin=None, root='/', env_prune=[]):
+ """ Execute an external command and return the line output of the command
+ in real-time.
+
+ @param command The command to run
+ @param argv The argument list
+ @param stdin The file object to read stdin from.
+ @param stdout Optional file object 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
+
+ Output from the file is not logged to program.log
+ This returns a generator with the lines from the command until it has finished
+ """
+ if env_prune is None:
+ env_prune = []
+
+ # Return the lines from stdout via a Queue
+ def queue_lines(out, queue):
+ for line in iter(out.readline, b''):
+ queue.put(line.strip())
+ out.close()
+
+ def chroot():
+ if root and root != '/':
+ os.chroot(root)
+
+ argv = [command] + argv
+ with program_log_lock:
+ program_log.info("Running... %s" % " ".join(argv))
+
+ env = augmentEnv()
+ for var in env_prune:
+ env.pop(var, None)
+ try:
+ proc = subprocess.Popen(argv,
+ stdin=stdin,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ bufsize=1,
+ preexec_fn=chroot, cwd=root, env=env)
+ except OSError as e:
+ program_log.error("Error running %s: %s" % (argv[0], e.strerror))
+ raise
+
+ q = Queue()
+ t = Thread(target=queue_lines, args=(proc.stdout, q))
+ t.daemon = True # thread dies with the program
+ t.start()
+
+ while True:
+ try:
+ line = q.get(timeout=.1)
+ yield line
+ q.task_done()
+ except Empty:
+ if proc.poll() is not None:
+ break
+ q.join()
+
+
## Run a shell.
def execConsole():
try:
--
1.8.1.4
11 years, 2 months
[lorax][PATCH] fix version query and add one to the log file
by Mark Hamzy
Fix "lorax -V" and add a "version is ???" to the log file so we can easily know
what version of lorax is used to build an iso.
Changed to try/import for versioning because the version file is autogenerated.
---
src/pylorax/__init__.py | 10 ++++++++++
src/sbin/lorax | 18 +++++++++++++-----
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index 069628e..8d00427 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -142,6 +142,14 @@ class Lorax(BaseLoraxClass):
assert self._configured
+ # get lorax version
+ try:
+ import pylorax.version
+ except ImportError:
+ vernum = "devel"
+ else:
+ vernum = pylorax.version.num
+
if domacboot:
try:
runcmd(["rpm", "-q", "hfsplus-tools"])
@@ -161,6 +169,8 @@ class Lorax(BaseLoraxClass):
self.init_stream_logging()
self.init_file_logging(logdir)
+
+ logger.debug("version is {0}".format (vernum))
logger.debug("using work directory {0.workdir}".format(self))
logger.debug("using log directory {0}".format(logdir))
diff --git a/src/sbin/lorax b/src/sbin/lorax
index d831b97..4aab540 100755
--- a/src/sbin/lorax
+++ b/src/sbin/lorax
@@ -76,7 +76,15 @@ def setup_logging(opts):
def main(args):
- version = "{0} 0.1".format(os.path.basename(args[0]))
+ # get lorax version
+ try:
+ import pylorax.version
+ except ImportError:
+ vernum = "devel"
+ else:
+ vernum = pylorax.version.num
+
+ version = "{0}-{1}".format(os.path.basename(args[0]), vernum)
usage = "%prog -p PRODUCT -v VERSION -r RELEASE -s REPOSITORY OUTPUTDIR"
parser = OptionParser(usage=usage)
@@ -136,15 +144,15 @@ def main(args):
# parse the arguments
opts, args = parser.parse_args()
+ if opts.showver:
+ print(version)
+ sys.exit(0)
+
try:
outputdir = os.path.abspath(args[0])
except IndexError:
parser.error("missing one or more required arguments")
- if opts.showver:
- print(version)
- sys.exit(0)
-
# check for the required arguments
if not opts.product or not opts.version or not opts.release \
or not opts.source or not outputdir:
--
1.8.1.4
11 years, 2 months
[PATCH] Network spoke: Fix reading of device type from combobox (#947120)
by Radek Vykydal
---
pyanaconda/ui/gui/spokes/network.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index ec5e076..62de1eb 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -511,7 +511,7 @@ class NetworkControlBox(object):
if rc == 1:
ai = self.builder.get_object("combobox_add_device").get_active_iter()
model = self.builder.get_object("liststore_add_device")
- dev_type = model[ai][1][0]
+ dev_type = model[ai][1]
self.add_device(dev_type)
def add_device(self, type):
--
1.7.11.7
11 years, 2 months
[PATCH] The Update Settings button should only be sensitive if you change something.
by Chris Lumens
This won't catch all cases. For instance, if you change a value and then
change it back to the original, the button will still be marked sensitive.
I think how it works now is probably good enough for most people.
---
pyanaconda/ui/gui/spokes/custom.glade | 11 +++++++++++
pyanaconda/ui/gui/spokes/custom.py | 10 ++++++++++
2 files changed, 21 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade
index 258e473..98f4911 100644
--- a/pyanaconda/ui/gui/spokes/custom.glade
+++ b/pyanaconda/ui/gui/spokes/custom.glade
@@ -587,6 +587,7 @@ use. Try something else?</property>
<property name="hexpand">True</property>
<property name="invisible_char">●</property>
<property name="completion">mountPointCompletion</property>
+ <signal name="changed" handler="on_value_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -618,6 +619,7 @@ use. Try something else?</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char">●</property>
+ <signal name="changed" handler="on_value_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -650,6 +652,7 @@ use. Try something else?</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
+ <signal name="changed" handler="on_value_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -683,6 +686,7 @@ use. Try something else?</property>
<property name="halign">start</property>
<property name="invisible_char">●</property>
<property name="width_chars">10</property>
+ <signal name="changed" handler="on_value_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -745,6 +749,7 @@ use. Try something else?</property>
<item translatable="yes">RAID</item>
</items>
<signal name="changed" handler="on_device_type_changed" swapped="no"/>
+ <signal name="changed" handler="on_value_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -761,6 +766,7 @@ use. Try something else?</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
<signal name="changed" handler="on_fs_type_changed" swapped="no"/>
+ <signal name="changed" handler="on_value_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -779,6 +785,7 @@ use. Try something else?</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_value_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">2</property>
@@ -797,6 +804,7 @@ use. Try something else?</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_reformat_toggled" swapped="no"/>
+ <signal name="toggled" handler="on_value_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">2</property>
@@ -831,6 +839,7 @@ use. Try something else?</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
<signal name="changed" handler="on_vg_changed" swapped="no"/>
+ <signal name="changed" handler="on_value_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -878,6 +887,7 @@ use. Try something else?</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">raidStoreFiltered</property>
+ <signal name="changed" handler="on_value_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="raidLevelRenderer"/>
<attributes>
@@ -914,6 +924,7 @@ use. Try something else?</property>
<object class="GtkButton" id="applyButton">
<property name="label" translatable="yes">_Update Settings</property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 0229350..4d0a1ec 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -505,6 +505,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._reformatCheckbox = self.builder.get_object("reformatCheckbox")
self._sizeEntry = self.builder.get_object("sizeEntry")
+ self._applyButton = self.builder.get_object("applyButton")
+
def initialize(self):
NormalSpoke.initialize(self)
@@ -649,6 +651,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._setCurrentFreeSpace()
self._updateSpaceDisplay()
+ self._applyButton.set_sensitive(False)
@property
def translated_new_install_name(self):
@@ -778,6 +781,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._accordion.expandPage(firstPage.pageTitle)
self.on_page_clicked(firstPage, mountpointToShow=mountpointToShow)
+ self._applyButton.set_sensitive(False)
+
###
### RIGHT HAND SIDE METHODS
###
@@ -2111,6 +2116,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
selector.set_chosen(True)
self._current_selector = selector
+ self._applyButton.set_sensitive(False)
self._configButton.set_sensitive(not selector._device.exists and
not selector._device.protected and
devicefactory.get_device_type(selector._device) != DEVICE_TYPE_LVM)
@@ -2414,6 +2420,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
def on_apply_clicked(self, button):
""" call _save_right_side, then, perhaps, populate_right_side. """
self._save_right_side(self._current_selector)
+ self._applyButton.set_sensitive(False)
def on_unlock_clicked(self, button):
""" try to open the luks device, populate, then call _do_refresh. """
@@ -2455,6 +2462,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._current_selector = None
self._do_refresh()
+ def on_value_changed(self, *args):
+ self._applyButton.set_sensitive(True)
+
help_text_template = N_("""You have chosen to manually set up the filesystems for your new %(productName)s installation. Before you begin, you might want to take a minute to learn the lay of the land. Quite a bit has changed.
The most important change is that creation of new filesystems has been streamlined. You no longer have to build complex devices like LVM logical volumes in stages (physical volume, then volume group, then logical volume) -- now you just create a logical volume and we'll handle the legwork of setting up the physical volumes and volume group to contain it. We'll also handle adjusting the volume group as you add, remove, and resize logical volumes so you don't have to worry about the mundane details.
--
1.8.1.2
11 years, 2 months
[PATCH] Fix two small problems with the UID/GID spin buttons (#929173, #929138).
by Chris Lumens
(1) We should default to 1000 for both, since that's the first allowable
user account (https://fedoraproject.org/wiki/Features/1000SystemAccounts).
(2) The values should be displayed by default.
---
pyanaconda/ui/gui/spokes/advanced_user.glade | 4 ++--
pyanaconda/ui/gui/spokes/user.py | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/advanced_user.glade b/pyanaconda/ui/gui/spokes/advanced_user.glade
index 6159f53..b57700f 100644
--- a/pyanaconda/ui/gui/spokes/advanced_user.glade
+++ b/pyanaconda/ui/gui/spokes/advanced_user.glade
@@ -421,14 +421,14 @@ Groups that do not already exist will be created; specify their GID in parenthes
</action-widgets>
</object>
<object class="GtkAdjustment" id="gid">
- <property name="lower">500</property>
+ <property name="lower">1000</property>
<property name="upper">32535</property>
<property name="value">1000</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="uid">
- <property name="lower">500</property>
+ <property name="lower">1000</property>
<property name="upper">32535</property>
<property name="value">1000</property>
<property name="step_increment">1</property>
diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index 84bcb8f..3e22847 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -80,6 +80,9 @@ class AdvancedUserDialog(GUIObject):
c_gid.set_active(bool(self._user.gid))
self._apply_checkboxes()
+ self.builder.get_object("spin_uid").update()
+ self.builder.get_object("spin_gid").update()
+
groups = []
for group_name in self._user.groups:
group = self._groupDict[group_name]
--
1.8.1.2
11 years, 2 months