Re: [PATCH] Trim "/dev/" from dev.path for all architectures (#702430)

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

 



> I thought about doing that, but then went for minimal.  But I like the
> idea of being overly paranoid at this point.  How about this revision:
> 
> diff --git a/command-stubs/list-harddrives-stub b/command-stubs/list-harddrives-stub
> index ee9efa8..75e8f89 100755
> --- a/command-stubs/list-harddrives-stub
> +++ b/command-stubs/list-harddrives-stub
> @@ -27,7 +27,12 @@ def main(argv):
>      lst = set()
>  
>      for dev in filter(lambda d: d.type != parted.DEVICE_DM, parted.getAllDevices()):
> -        lst.add((dev.path[5:], dev.getSize()))
> +        if dev.path.startswith("/dev/"):
> +            path = dev.path[5:]
> +        else:
> +            path = dev.path
> +
> +        lst.add((path, dev.getSize()))
>  
>      lst = list(lst)
>      lst.sort()

Yeah, that's what I was thinking of.

- Chris

_______________________________________________
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