[PATCH] Mountpoint encrypted checkbox reflects container state (#1000031)
by Brian C. Lane
When the container is encrypted the mountpoint's encryption checkbox is
insensitive, but doesn't reflect the encrypted state. This changes the
checkbox so that when it the container is encrypted it will be
insensitive and checked as well as setting a tooltip saying "The
Container is encrypted."
---
pyanaconda/ui/gui/spokes/custom.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 5c91069..841030a 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -919,7 +919,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# ENCRYPTION
old_encrypted = isinstance(device, LUKSDevice)
- encrypted = self._encryptCheckbox.get_active()
+ encrypted = self._encryptCheckbox.get_active() and self._encryptCheckbox.is_sensitive()
changed_encryption = (old_encrypted != encrypted)
old_device_info["encrypted"] = old_encrypted
new_device_info["encrypted"] = encrypted
@@ -1381,6 +1381,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# The encryption checkbutton should not be sensitive if there is
# existing encryption below the leaf layer.
self._encryptCheckbox.set_sensitive(False)
+ self._encryptCheckbox.set_active(True)
+ self._encryptCheckbox.set_tooltip_text(_("The container is encrypted."))
+ else:
+ self._encryptCheckbox.set_tooltip_text("")
# Set up the filesystem type combo.
self._setup_fstype_combo(device)
@@ -1978,6 +1982,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
log.debug("%s -> %s", container_name, self._device_container_name)
if container_name == self._device_container_name:
+ self.on_update_settings_clicked(None)
return
log.debug("renaming container %s to %s", container_name, self._device_container_name)
@@ -2002,6 +2007,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
else:
# no match found, just update selectors and return
self._update_selectors()
+ self.on_update_settings_clicked(None)
return
c = self._storage_playground.devicetree.getDeviceByName(self._device_container_name)
@@ -2015,6 +2021,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._containerStore.remove(self._containerStore.get_iter_from_string("%s" % (idx + 1)))
self._update_selectors()
+ self.on_update_settings_clicked(None)
def on_container_changed(self, combo):
ndx = combo.get_active()
--
1.9.3
9 years, 10 months
[pykickstart] Add autopart --fstype support (#1112697)
by Brian C. Lane
This will allow the user to specify the filesystem type to use instead
of the default when auto-partitioning.
---
pykickstart/commands/autopart.py | 41 ++++++++++++++++++++++++++++++++++++++++
pykickstart/handlers/f21.py | 2 +-
tests/commands/autopart.py | 19 +++++++++++++++++++
3 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/pykickstart/commands/autopart.py b/pykickstart/commands/autopart.py
index e19a89f..19fb266 100644
--- a/pykickstart/commands/autopart.py
+++ b/pykickstart/commands/autopart.py
@@ -336,3 +336,44 @@ class F20_AutoPart(F18_AutoPart):
conflicting_command
raise KickstartParseError(formatErrorMsg(self.lineno, msg=errorMsg))
return retval
+
+class F21_AutoPart(F20_AutoPart):
+ removedKeywords = F20_AutoPart.removedKeywords
+ removedAttrs = F20_AutoPart.removedAttrs
+
+ def __init__(self, writePriority=100, *args, **kwargs):
+ F20_AutoPart.__init__(self, writePriority=writePriority, *args, **kwargs)
+ self.fstype = kwargs.get("fstype", "")
+
+ def __str__(self):
+ retval = F20_AutoPart.__str__(self)
+ if not self.autopart:
+ return retval
+
+ if self.fstype:
+ # remove any trailing newline
+ retval = retval.strip()
+ retval += " --fstype=%s" % self.fstype
+ retval += "\n"
+
+ return retval
+
+ def _getParser(self):
+ op = F20_AutoPart._getParser(self)
+ op.add_option("--fstype")
+ return op
+
+ def parse(self, args):
+ # call the overriden command to do it's job first
+ retval = F20_AutoPart.parse(self, args)
+
+ # btrfs is not a valid filesystem type
+ if self.fstype == "btrfs":
+ raise KickstartParseError(formatErrorMsg(self.lineno,
+ msg=_("autopart --fstype=btrfs is not valid fstype, use --type=btrfs instead")))
+
+ if self._typeAsStr() == "btrfs" and self.fstype:
+ raise KickstartParseError(formatErrorMsg(self.lineno,
+ msg=_("autopart --fstype cannot be used with --type=btrfs")))
+
+ return retval
diff --git a/pykickstart/handlers/f21.py b/pykickstart/handlers/f21.py
index 23220ca..cac66bc 100644
--- a/pykickstart/handlers/f21.py
+++ b/pykickstart/handlers/f21.py
@@ -29,7 +29,7 @@ class F21Handler(BaseHandler):
commandMap = {
"auth": commands.authconfig.FC3_Authconfig,
"authconfig": commands.authconfig.FC3_Authconfig,
- "autopart": commands.autopart.F20_AutoPart,
+ "autopart": commands.autopart.F21_AutoPart,
"autostep": commands.autostep.FC3_AutoStep,
"bootloader": commands.bootloader.F21_Bootloader,
"btrfs": commands.btrfs.F17_BTRFS,
diff --git a/tests/commands/autopart.py b/tests/commands/autopart.py
index 962b02a..311f253 100644
--- a/tests/commands/autopart.py
+++ b/tests/commands/autopart.py
@@ -147,8 +147,27 @@ class F18_TestCase(F17_TestCase):
class F20_TestCase(F18_TestCase):
def runTest(self):
+ F18_TestCase.runTest(self)
+
self.assert_parse("autopart --type=thinp",
"autopart --type=thinp\n")
+class F21_TestCase(F20_TestCase):
+ def runTest(self):
+ F20_TestCase.runTest(self)
+
+ # pass
+ self.assert_parse("autopart --fstype=ext4",
+ 'autopart --fstype=ext4\n')
+ self.assert_parse("autopart --encrypted --fstype=ext4",
+ 'autopart --encrypted --fstype=ext4\n')
+ self.assert_parse("autopart --type=lvm --fstype=xfs",
+ "autopart --type=lvm --fstype=xfs\n")
+
+ # fail
+ self.assert_parse_error("autopart --fstype")
+ self.assert_parse_error("autopart --fstype=btrfs")
+ self.assert_parse_error("autopart --type=btrfs --fstype=xfs")
+
if __name__ == "__main__":
unittest.main()
--
1.9.3
9 years, 10 months
[PATCH] makeupdates: Put systemd files under /usr/lib/
by Brian C. Lane
Otherwise the /lib symlink gets clobbered.
---
scripts/makeupdates | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/makeupdates b/scripts/makeupdates
index d1ccf89..1de193a 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -273,10 +273,10 @@ def copyUpdatedFiles(tag, updates, cwd):
install_to_dir(gitfile, "usr/sbin")
elif gitfile.endswith('.service') or gitfile.endswith(".target"):
# same for systemd services
- install_to_dir(gitfile, "lib/systemd/system")
+ install_to_dir(gitfile, "usr/lib/systemd/system")
elif gitfile.endswith('/anaconda-generator'):
# yeah, this should probably be more clever..
- install_to_dir(gitfile, "lib/systemd/system-generators")
+ install_to_dir(gitfile, "usr/lib/systemd/system-generators")
elif gitfile == "data/tmux.conf":
install_to_dir(gitfile, "usr/share/anaconda")
elif gitfile == "data/anaconda-gtk.css":
--
1.9.3
9 years, 10 months
[PATCH 0/2] Make X startup more deterministic
by David Shea
This irons out some of the weird races we had during X startup, makes anaconda
fail if metacity doesn't start, and switches to tty1 if an exception happens
before python-meh is activated so you don't get stuck staring at a blank screen
(you get stuck staring at a traceback)
David Shea (2):
Remove surprises from X startup.
Switch to tty1 if we get an exception before meh is setup
anaconda | 215 +++++++++++++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 168 insertions(+), 47 deletions(-)
--
2.0.0
9 years, 10 months
[PATCH 0/4] Make --dirinstall easier to use
by Brian C. Lane
These patches make it so you can run
anaconda --dirinstall=/var/tmp/shiny-new-tree/
without messing around with environmental variables.
Brian C. Lane (3):
Drop ROOT_PATH, add a method to set it
Modify --dirinstall to take a path
Fix storage checker docstring
anaconda | 25 ++++++++++++++++---------
pyanaconda/constants.py | 5 -----
pyanaconda/iutil.py | 24 +++++++++++++++++-------
pyanaconda/ui/lib/space.py | 4 ++--
4 files changed, 35 insertions(+), 23 deletions(-)
--
1.9.3
9 years, 10 months
[lorax] The theme has been absorbed into gtk3
by Brian C. Lane
and is now the default, so just use it instead of writing a settings.ini
---
share/runtime-postinstall.tmpl | 4 ----
1 file changed, 4 deletions(-)
diff --git a/share/runtime-postinstall.tmpl b/share/runtime-postinstall.tmpl
index 55e6362..0fd3bf7 100644
--- a/share/runtime-postinstall.tmpl
+++ b/share/runtime-postinstall.tmpl
@@ -96,10 +96,6 @@ gconfset /apps/metacity/global_keybindings/switch_windows string disabled
gconfset /desktop/gnome/interface/accessibility bool true
gconfset /desktop/gnome/interface/at-spi-corba bool true
-## Make sure we have a GTK theme
-mkdir etc/gtk-3.0/
-copy usr/share/gtk-3.0/settings.ini etc/gtk-3.0/
-
## Some settings are controlled by gsettings now.
install ${configdir}/org.gnome.desktop.wm.keybindings.gschema.override usr/share/glib-2.0/schemas
runcmd chroot ${root} glib-compile-schemas /usr/share/glib-2.0/schemas
--
1.9.3
9 years, 10 months
[anaconda][master][Python 3][PATCH] Make octal literals Python 3 compatible
by Martin Kolman
The 0o<number> syntax seems to work fine in both
Python 2.7 & Python 3.
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
pyanaconda/anaconda.py | 2 +-
pyanaconda/bootloader.py | 6 +++---
pyanaconda/install.py | 2 +-
pyanaconda/iutil.py | 4 ++--
pyanaconda/kickstart.py | 6 +++---
pyanaconda/packaging/livepayload.py | 2 +-
6 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py
index 210f20a..de2ba04 100644
--- a/pyanaconda/anaconda.py
+++ b/pyanaconda/anaconda.py
@@ -230,7 +230,7 @@ class Anaconda(object):
if root is None:
root = iutil.getSysroot()
if not os.path.isdir("%s/etc/X11" %(root,)):
- os.makedirs("%s/etc/X11" %(root,), mode=0755)
+ os.makedirs("%s/etc/X11" %(root,), mode=0o755)
f = open("%s/etc/X11/xorg.conf" %(root,), 'w')
f.write('Section "Device"\n\tIdentifier "Videocard0"\n\tDriver "%s"\nEndSection\n' % self.xdriver)
f.close()
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index c0e34da..10292c7 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -226,7 +226,7 @@ class BootLoader(object):
name = "Generic Bootloader"
packages = []
config_file = None
- config_file_mode = 0600
+ config_file_mode = 0o600
can_dual_boot = False
can_update = False
image_label_attr = "label"
@@ -1398,7 +1398,7 @@ class GRUB2(GRUB):
packages = ["grub2"]
_config_file = "grub.cfg"
_config_dir = "grub2"
- config_file_mode = 0600
+ config_file_mode = 0o600
defaults_file = "/etc/default/grub"
can_dual_boot = True
can_update = True
@@ -1542,7 +1542,7 @@ class GRUB2(GRUB):
header.write("%s\n" % password_line)
header.write("EOF\n")
header.close()
- os.chmod(users_file, 0700)
+ os.chmod(users_file, 0o700)
def write_config(self):
self.add_crash_args()
diff --git a/pyanaconda/install.py b/pyanaconda/install.py
index c205584..f136384 100644
--- a/pyanaconda/install.py
+++ b/pyanaconda/install.py
@@ -48,7 +48,7 @@ def _writeKS(ksdata):
f.write(str(ksdata))
# Make it so only root can read - could have passwords
- os.chmod(path, 0600)
+ os.chmod(path, 0o600)
def doConfiguration(storage, payload, ksdata, instClass):
from pyanaconda.kickstart import runPostScripts
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index f2b28a9..642e7b0 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -326,7 +326,7 @@ def mkdirChain(directory):
"""
try:
- os.makedirs(directory, 0755)
+ os.makedirs(directory, 0o755)
except OSError as e:
try:
if e.errno == errno.EEXIST and stat.S_ISDIR(os.stat(directory).st_mode):
@@ -474,7 +474,7 @@ def dracut_eject(device):
f.write("eject %s\n" % (device,))
f.close()
- os.chmod(DRACUT_SHUTDOWN_EJECT, 0755)
+ os.chmod(DRACUT_SHUTDOWN_EJECT, 0o755)
log.info("Wrote dracut shutdown eject hook for %s", device)
except (IOError, OSError) as e:
log.error("Error writing dracut shutdown eject hook for %s: %s", device, e)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index cbb48f0..97f0ab9 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -98,7 +98,7 @@ class AnacondaKSScript(KSScript):
os.write(fd, self.script)
os.close(fd)
- os.chmod(path, 0700)
+ os.chmod(path, 0o700)
# Always log stdout/stderr from scripts. Using --log just lets you
# pick where it goes. The script will also be logged to program.log
@@ -1067,7 +1067,7 @@ class PartitionData(commands.partition.F18_PartData):
ty = "macefi"
else:
ty = "EFI System Partition"
- self.fsopts = "defaults,uid=0,gid=0,umask=0077,shortname=winnt"
+ self.fsopts = "defaults,uid=0,gid=0,umask=0o077,shortname=winnt"
else:
if self.fstype != "":
ty = self.fstype
@@ -1671,7 +1671,7 @@ class SpokeRegistry(dict):
def execute(self, storage, ksdata, instClass, users):
path = os.path.join(iutil.getSysroot(), "var", "lib", "inital-setup")
try:
- os.makedirs(path, 0755)
+ os.makedirs(path, 0o755)
except OSError:
pass
f = open(os.path.join(path, "configured.ini"), "a")
diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
index be0ea91..f5fb6a9 100644
--- a/pyanaconda/packaging/livepayload.py
+++ b/pyanaconda/packaging/livepayload.py
@@ -334,7 +334,7 @@ class LiveImageKSPayload(LiveImagePayload):
img_file = os.path.basename(sorted(img_files)[0])
# move the mount to IMAGE_DIR
- os.makedirs(IMAGE_DIR, 0755)
+ os.makedirs(IMAGE_DIR, 0o755)
# work around inability to move shared filesystems
iutil.execWithRedirect("mount",
["--make-rprivate", "/"])
--
1.9.3
9 years, 10 months
[libblockdev 00/10] Some libblockdev fiddles
by Anne Mulhern
The first four are things I stumbled across while trying to build w/out
warnings.
The last five are all about the Makefile. There's plenty more to do, but I'ld
like feedback before I go any further.
mulhern (10):
Do not start using next_line until needed.
Do not check for NULL value for ret
Discard const modifier on ret
Put const modifier on some things very heavily
Add an initial .gitignore file.
Use pattern rules to generate plugin boilerplate.
Remove unnecessary header file from LIBRARY_FILES
Start a clean target.
Make build-library into a file target.
Leave out link-time flags when compiling.
.gitignore | 6 ++++++
Makefile | 50 +++++++++++++++++++++++++-------------------
src/lib/plugin_apis/common.h | 2 +-
src/plugins/crypto.c | 6 ++----
src/plugins/lvm.c | 4 ++--
src/plugins/swap.c | 7 +++----
src/plugins/test_lvm.c | 2 +-
src/utils/sizes.c | 2 +-
8 files changed, 44 insertions(+), 35 deletions(-)
create mode 100644 .gitignore
--
1.9.3
9 years, 10 months
[anaconda][master][Python 3][PATCH 0/2] Two more steps towards Python 3
by Martin Kolman
The first patch makes our use of the reduce function Python 3 compatible
(yes, we DO use reduce!) and the second patch makes the next() generator calls
Python compatible.
I've done some simple Python 3 compatibility scanning by running the Anaconda
source through python3 -m compileall and 2to3 (lives in python-tools BTW).
>From the output it looks like that most of the stuff that can be easily
changed to work in both 2 & 3 without special compatibility machinery has
been already done.
The remaining changes are what I would call "flag day changes" as they
either can degrade performance in Python 2 (using items() in place of iteritems(), etc.)
or are outright Python 2 incompatible without additional Python 3 compatibility machinery
(mostly standard library module renames and reorganizations).
As I don't think maintaining compatibility with Python 2 is needed once Anaconda
works with Python 3 (unlike for Pykickstart & Blivet),so the remaining changes should
be done once the Python 3 "flag day" comes without regard for Python 2 compatibility.
Martin Kolman (2):
Make reduce function usage Python 3 compatible
Use the built-in next() function for generators
pyanaconda/addons.py | 5 +++--
pyanaconda/anaconda_argparse.py | 2 +-
pyanaconda/bootloader.py | 2 +-
pyanaconda/ui/gui/hubs/progress.py | 2 +-
pyanaconda/ui/tui/simpleline/base.py | 3 ++-
scripts/anaconda-yum | 4 ++--
6 files changed, 10 insertions(+), 8 deletions(-)
--
1.9.3
9 years, 10 months