Re: [virt-bootstrap] [PATCH v6 10/26] Split the function mapping_uid_gid

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

 



On Thu, 2017-08-17 at 10:39 +0100, Radostin Stoyanov wrote:
> Split the function mapping_uid_gid in two parts so that the code which
> makes both lists `map_uid` and `map_gid` with equal length can be
> reused.
> ---
>  src/virtBootstrap/utils.py | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py
> index 3b488bb..7604766 100644
> --- a/src/virtBootstrap/utils.py
> +++ b/src/virtBootstrap/utils.py
> @@ -498,9 +498,9 @@ def map_id(path, map_uid, map_gid):
>              os.lchown(file_path, new_uid, new_gid)
>  
>  
> -def mapping_uid_gid(dest, uid_map, gid_map):
> +def balance_uid_gid_maps(uid_map, gid_map):
>      """
> -    Mapping ownership for each uid_map and gid_map.
> +    Make sure the UID/GID list of mappings have the same lenght.

typo: 'length'

>      """
>      len_diff = len(uid_map) - len(gid_map)
>  
> @@ -509,5 +509,11 @@ def mapping_uid_gid(dest, uid_map, gid_map):
>      elif len_diff > 0:
>          gid_map += [None] * len_diff
>  
> +
> +def mapping_uid_gid(dest, uid_map, gid_map):
> +    """
> +    Mapping ownership for each uid_map and gid_map.
> +    """
> +    balance_uid_gid_maps(uid_map, gid_map)
>      for uid, gid in zip(uid_map, gid_map):
>          map_id(dest, uid, gid)

ACK with the typo fixed.

--
Cedric

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux