Re: [PATCH] Fix referring to disks by-label, by-uuid, etc (#575855).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good for master and f13-branch.

On Tue, 2010-03-23 at 10:31 -0400, Chris Lumens wrote:
> Turns out that the symlinks all start with /dev/, but I've been adding that
> to the front of the symlink strings anyway so none of the comparisons work.
> While I'm at it, allow people to specify disks with or without the leading
> /dev/ in kickstart.
> ---
>  kickstart.py    |    3 +++
>  storage/udev.py |    4 ++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/kickstart.py b/kickstart.py
> index 3578d11..fa06c48 100644
> --- a/kickstart.py
> +++ b/kickstart.py
> @@ -166,6 +166,9 @@ def getEscrowCertificate(anaconda, url):
>      return anaconda.storage.escrowCertificates[url]
>  
>  def deviceMatches(spec):
> +    if not spec.startswith("/dev/"):
> +        spec = "/dev/" + spec
> +
>      matches = udev_resolve_glob(spec)
>      dev = udev_resolve_devspec(spec)
>  
> diff --git a/storage/udev.py b/storage/udev.py
> index 5faafa3..df961db 100644
> --- a/storage/udev.py
> +++ b/storage/udev.py
> @@ -49,7 +49,7 @@ def udev_resolve_devspec(devspec):
>              break
>          else:
>              for link in dev["symlinks"]:
> -                if devspec == "/dev/" + link:
> +                if devspec == link:
>                      ret = dev
>                      break
>  
> @@ -71,7 +71,7 @@ def udev_resolve_glob(glob):
>              ret.append(name)
>          else:
>              for link in dev["symlinks"]:
> -                if fnmatch.fnmatch("/dev/" + link, glob):
> +                if fnmatch.fnmatch(link, glob):
>                      ret.append(name)
>  
>      return ret


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux