[blivet:master 19/20] Slightly rewrite loop to avoid a redefining builtin error

Brian C. Lane bcl at redhat.com
Tue Apr 15 00:41:20 UTC 2014


On Fri, Apr 11, 2014 at 02:04:01PM -0400, mulhern wrote:
> More elegant than changing the name.
> 
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>  blivet/iscsi.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/blivet/iscsi.py b/blivet/iscsi.py
> index 18b8c86..659bc3b 100644
> --- a/blivet/iscsi.py
> +++ b/blivet/iscsi.py
> @@ -220,8 +220,8 @@ class iscsi(object):
>          os.close(fd)
>          self.initiatorSet = True
>  
> -        for dir in ['ifaces','isns','nodes','send_targets','slp','static']:
> -            fulldir = "/var/lib/iscsi/%s" % (dir,)
> +        for fulldir in (os.path.join("/var/lib/iscsi", dir) for dir in \

Should use d here instead of dir

> +            ['ifaces','isns','nodes','send_targets','slp','static']):
>              if not os.path.isdir(fulldir):
>                  os.makedirs(fulldir, 0755)
>  
> -- 
> 1.8.3.1

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list