[blivet][master/rhel7-branch] If any zFCP devices are used, always write /etc/zfcp.conf (#1194241)

Vratislav Podzimek vpodzime at redhat.com
Wed Jun 10 06:11:32 UTC 2015


On Tue, 2015-06-09 at 19:33 -0400, Samantha N. Bueno wrote:
> I'm on the fence about adding this to master on blivet, since I'm
> going to be rewriting/moving the majority of what's left in blivet.zfcp
> to libblockdev in about a month, so this change can be rhel7-branch
> only.
> 
> ====
> 
> Previously, /etc/zfcp.conf was only created if you manually added zFCP
> devices during installation. If you'd specified devices in the CMS
> conf file and used these for system partitions (/, /home) dracut args
> were added to the bootloader conf file. But if you, e.g. had only a
> non-system partition like /data residing on a zFCP device, it was not
> brought online following installation + reboot since zfcp.conf was
> never written and dracut args weren't added to the bootloader config.
> 
> So, just unconditionally create /etc/zfcp.conf now.
> 
> Resolves: rhbz#1194241
> ---
>  blivet/__init__.py |  2 +-
>  blivet/zfcp.py     | 12 ++++++++++--
>  2 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/blivet/__init__.py b/blivet/__init__.py
> index 3b28ad9..80872cd 100644
> --- a/blivet/__init__.py
> +++ b/blivet/__init__.py
> @@ -1604,7 +1604,7 @@ class Blivet(object):
>          self.makeMtab()
>          self.iscsi.write(_sysroot, self)
>          self.fcoe.write(_sysroot)
> -        self.zfcp.write(_sysroot)
> +        self.zfcp.write(_sysroot, self.devicetree.getDevicesByType("zfcp"))
>          write_dasd_conf(self.dasd, _sysroot)
>  
>      def turnOnSwap(self):
> diff --git a/blivet/zfcp.py b/blivet/zfcp.py
> index 5036540..dbc1269 100644
> --- a/blivet/zfcp.py
> +++ b/blivet/zfcp.py
> @@ -406,8 +406,16 @@ class ZFCP:
>              except ValueError as e:
>                  log.warn("%s", str(e))
>  
> -    def write(self, root):
> -        if len(self.fcpdevs) == 0:
> +    def write(self, root, zfcpdevs):
> +        # make sure that any zfcp devices (not only those which were manually
> +        # added) used during installation are included in /etc/zfcp.conf
> +        if zfcpdevs:
> +            for d in zfcpdevs:
> +                dev = ZFCPDevice(d.hba_id, d.wwpn, d.fcp_lun)
> +                if dev not in self.fcpdevs:
> +                    self.fcpdevs.add(dev)
> +
> +        if not self.fcpdevs:
>              return
>          f = open(root + zfcpconf, "w")
>          for d in self.fcpdevs:
Looks good to me.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list