[anaconda] Make anaconda changes necessary for libblockdev s390 plugin.
Samantha N. Bueno
sbueno+anaconda at redhat.com
Tue May 19 15:41:02 UTC 2015
On Tue, May 19, 2015 at 01:45:35PM +0200, Vratislav Podzimek wrote:
> On Mon, 2015-05-18 at 15:10 -0400, Samantha N. Bueno wrote:
> > ---
> > pyanaconda/anaconda.py | 10 ++++++++++
> > pyanaconda/ui/gui/spokes/advstorage/dasd.py | 9 +++++----
> > pyanaconda/ui/gui/spokes/advstorage/zfcp.py | 12 +++++++-----
> > pyanaconda/ui/gui/spokes/lib/dasdfmt.py | 11 +++++------
> > pyanaconda/ui/gui/spokes/storage.py | 12 ++++++------
> > pyanaconda/ui/tui/spokes/storage.py | 17 +++++++++--------
> > 6 files changed, 42 insertions(+), 29 deletions(-)
> >
> > diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py
> > index cb4138d..896aae7 100644
> > --- a/pyanaconda/anaconda.py
> > +++ b/pyanaconda/anaconda.py
> > @@ -167,11 +167,21 @@ class Anaconda(object):
> > def storage(self):
> > if not self._storage:
> > import blivet
> > + import blivet.arch
> > + from gi.repository import BlockDev as blockdev
> > self._storage = blivet.Blivet(ksdata=self.ksdata)
> >
> > if self.instClass.defaultFS:
> > self._storage.setDefaultFSType(self.instClass.defaultFS)
> >
> > + if blivet.arch.isS390():
> > + # want to make sure s390 plugin is loaded
> > + if "s390" not in blockdev.get_available_plugin_names():
> > + plugin = blockdev.PluginSpec()
> > + plugin.name = blockdev.Plugin.S390
> > + plugin.so_name = None
> > + blockdev.reinit([plugin], reload=False)
> > +
> > return self._storage
> >
> > def dumpState(self):
> > diff --git a/pyanaconda/ui/gui/spokes/advstorage/dasd.py b/pyanaconda/ui/gui/spokes/advstorage/dasd.py
> > index 88e1a01..61fe5e5 100644
> > --- a/pyanaconda/ui/gui/spokes/advstorage/dasd.py
> > +++ b/pyanaconda/ui/gui/spokes/advstorage/dasd.py
> > @@ -21,6 +21,7 @@
> >
> > from pyanaconda.ui.gui import GUIObject
> > from pyanaconda.ui.gui.utils import gtk_action_nowait
> > +from gi.repository import BlockDev as blockdev
> >
> > from blivet.devicelibs.dasd import sanitize_dasd_dev_input, online_dasd
> >
> > @@ -83,7 +84,7 @@ class DASDDialog(GUIObject):
> > self._conditionNotebook.set_current_page(1)
> >
> > try:
> > - device = sanitize_dasd_dev_input(self._deviceEntry.get_text())
> > + device = blockdev.s390.sanitize_dev_input(self._deviceEntry.get_text())
> > except ValueError as e:
> > _config_error = str(e)
> > self.builder.get_object("deviceErrorLabel").set_text(_config_error)
> > @@ -126,8 +127,8 @@ class DASDDialog(GUIObject):
> > """
> > # attempt to add the device
> > try:
> > - online_dasd(device)
> > + blockdev.s390.dasd_online(device)
> > self._update_devicetree = True
> > - except ValueError as e:
> > - self._discoveryError = str(e)
> > + except blockdev.S390Error as err:
> > + self._discoveryError = str(err)
> > return
> > diff --git a/pyanaconda/ui/gui/spokes/advstorage/zfcp.py b/pyanaconda/ui/gui/spokes/advstorage/zfcp.py
> > index 0674b1f..3dfc9a5 100644
> > --- a/pyanaconda/ui/gui/spokes/advstorage/zfcp.py
> > +++ b/pyanaconda/ui/gui/spokes/advstorage/zfcp.py
> > @@ -21,6 +21,8 @@
> >
> > from pyanaconda.ui.gui import GUIObject
> > from pyanaconda.ui.gui.utils import gtk_action_nowait
> > +from gi.repository import BlockDev as blockdev
> > +from gi.repository import GLib
> No longer need to import GLib as the exceptions are caught as
> BlockDev.S390Error instances.
Rats, missed one. Fixed.
Samantha
More information about the anaconda-patches
mailing list