» Linux Archive
Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.
» Sponsor
» Sponsor
05-02-2012, 07:10 PM
Write out storage configuration as part of turnOnFilesystems.
writeEscrowPackets doesn't need an anaconda instance anymore.
---
pyanaconda/storage/__init__.py | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 2b9e453..33f242c 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -250,6 +250,8 @@ def turnOnFilesystems(storage, errorcb=None):
storage.mountFilesystems(raiseErrors=False,
readOnly=False,
skipRoot=False)
+ storage.write()
+ writeEscrowPackets(storage)
else:
if upgrade_migrate:
# we should write out a new fstab with the migrated fstype
@@ -260,19 +262,16 @@ def turnOnFilesystems(storage, errorcb=None):
# and make sure /dev is mounted so we can read the bootloader
bindMountDevDirectory(ROOT_PATH)
-def writeEscrowPackets(anaconda):
+def writeEscrowPackets(storage):
escrowDevices = filter(lambda d: d.format.type == "luks" and
d.format.escrow_cert,
- anaconda.storage.devices)
+ storage.devices)
if not escrowDevices:
return
log.debug("escrow: writeEscrowPackets start")
- wait_win = anaconda.intf.waitWindow(_("Running..."),
- _("Storing encryption keys"))
-
nss.nss.nss_init_nodb() # Does nothing if NSS is already initialized
backupPassphrase = generateBackupPassphrase()
@@ -283,15 +282,9 @@ def writeEscrowPackets(anaconda):
device.format.escrow(ROOT_PATH + "/root",
backupPassphrase)
- wait_win.pop()
except (IOError, RuntimeError) as e:
- wait_win.pop()
- anaconda.intf.messageWindow(_("Error"),
- _("Error storing an encryption key: "
- "%s
") % str(e), type="custom",
- custom_icon="error",
- custom_buttons=[_("_Exit installer")])
- sys.exit(1)
+ # TODO: real error handling
+ log.error("failed to store encryption key: %s" % e)
log.debug("escrow: writeEscrowPackets done")
@@ -1265,6 +1258,9 @@ class Storage(object):
return pkgs
def write(self):
+ if not os.path.isdir("%s/etc" % ROOT_PATH):
+ os.mkdir("%s/etc" % ROOT_PATH)
+
self.fsset.write()
self.makeMtab()
self.iscsi.write(self)
--
1.7.7.6
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
05-02-2012, 07:43 PM
Write out storage configuration as part of turnOnFilesystems.
> @@ -283,15 +282,9 @@ def writeEscrowPackets(anaconda):
> device.format.escrow(ROOT_PATH + "/root",
> backupPassphrase)
>
> - wait_win.pop()
> except (IOError, RuntimeError) as e:
> - wait_win.pop()
> - anaconda.intf.messageWindow(_("Error"),
> - _("Error storing an encryption key: "
> - "%s
") % str(e), type="custom",
> - custom_icon="error",
> - custom_buttons=[_("_Exit installer")])
> - sys.exit(1)
> + # TODO: real error handling
> + log.error("failed to store encryption key: %s" % e)
>
> log.debug("escrow: writeEscrowPackets done")
>
Are you thinking about just using another exception class here like
everywhere else, or doing something different?
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
05-02-2012, 08:43 PM
Write out storage configuration as part of turnOnFilesystems.
On Wed, 2012-05-02 at 15:43 -0400, Chris Lumens wrote:
> > @@ -283,15 +282,9 @@ def writeEscrowPackets(anaconda):
> > device.format.escrow(ROOT_PATH + "/root",
> > backupPassphrase)
> >
> > - wait_win.pop()
> > except (IOError, RuntimeError) as e:
> > - wait_win.pop()
> > - anaconda.intf.messageWindow(_("Error"),
> > - _("Error storing an encryption key: "
> > - "%s
") % str(e), type="custom",
> > - custom_icon="error",
> > - custom_buttons=[_("_Exit installer")])
> > - sys.exit(1)
> > + # TODO: real error handling
> > + log.error("failed to store encryption key: %s" % e)
> >
> > log.debug("escrow: writeEscrowPackets done")
> >
>
> Are you thinking about just using another exception class here like
> everywhere else, or doing something different?
Probably the same as everywhere else: instantiate an Exception subclass,
run the error handler, do what it says.
>
> - Chris
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
All times are GMT. The time now is 01:12 PM .
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org