[rhinstaller/blivet/pulls/71 master] Consolidate common code in DeviceFormat class methods.

vpodzime installerbot-noreply at redhat.com
Fri Apr 10 06:44:38 UTC 2015


> @@ -96,55 +95,29 @@ def dict(self):
>                    "peStart": self.peStart, "dataAlignment": self.dataAlignment})
>          return d
>  
> -    def create(self, **kwargs):
> -        """ Write the formatting to the specified block device.
> -
> -            :keyword device: path to device node
> -            :type device: str
> -            :raises: FormatCreateError
> -            :returns: None.
> -
> -            .. :note::
> -
> -                If a device node path is passed to this method it will overwrite
> -                any previously set value of this instance's "device" attribute.
> -        """
> +    def _create(self, **kwargs):
>          log_method_call(self, device=self.device,
>                          type=self.type, status=self.status)
>  
> -        try:
> -            DeviceFormat.create(self, **kwargs)
> -            # Consider use of -Z|--zero
> -            # -f|--force or -y|--yes may be required
> +        # Consider use of -Z|--zero
> +        # -f|--force or -y|--yes may be required
>  
> -            # lvm has issues with persistence of metadata, so here comes the
> -            # hammer...
> +        # lvm has issues with persistence of metadata, so here comes the
> +        # hammer...
> +        self.exists = True

Isn't it there to prevent ``pvcreate`` from having issues with existing metadata/format on the device? libblockdev's ``pvcreate`` doesn't use the ``-f`` option to force PV creation and so didn't blivet's ``pvcreate`` IIRC.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/71#discussion_r28125147


More information about the anaconda-patches mailing list