summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/cc_apt_update_upgrade.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-01-12 16:55:17 +0100
committerScott Moser <smoser@ubuntu.com>2012-01-12 16:55:17 +0100
commit07abdfcfe4c4458fbf05a250f5eff81db151f4cb (patch)
tree5fe025ef1502b4eb8da64f1c8f9d391f68eb6c18 /cloudinit/CloudConfig/cc_apt_update_upgrade.py
parent6a2031c4dc005d9a0f42b10200b828eee5cf166f (diff)
downloadvyos-cloud-init-07abdfcfe4c4458fbf05a250f5eff81db151f4cb.tar.gz
vyos-cloud-init-07abdfcfe4c4458fbf05a250f5eff81db151f4cb.zip
[PATCH 07/13] Fix pylint warnings W0622 (redefining built-in 'xyz')
From: Juerg Haefliger <juerg.haefliger@hp.com>
Diffstat (limited to 'cloudinit/CloudConfig/cc_apt_update_upgrade.py')
-rw-r--r--cloudinit/CloudConfig/cc_apt_update_upgrade.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/cloudinit/CloudConfig/cc_apt_update_upgrade.py b/cloudinit/CloudConfig/cc_apt_update_upgrade.py
index 22651067..d466f3c4 100644
--- a/cloudinit/CloudConfig/cc_apt_update_upgrade.py
+++ b/cloudinit/CloudConfig/cc_apt_update_upgrade.py
@@ -102,14 +102,14 @@ def handle(_name,cfg,cloud,log,_args):
return(True)
def mirror2lists_fileprefix(mirror):
- file=mirror
+ string=mirror
# take of http:// or ftp://
- if file.endswith("/"): file=file[0:-1]
- pos=file.find("://")
+ if string.endswith("/"): string=string[0:-1]
+ pos=string.find("://")
if pos >= 0:
- file=file[pos+3:]
- file=file.replace("/","_")
- return file
+ string=string[pos+3:]
+ string=string.replace("/","_")
+ return string
def rename_apt_lists(omirror,new_mirror,lists_d="/var/lib/apt/lists"):
@@ -117,8 +117,8 @@ def rename_apt_lists(omirror,new_mirror,lists_d="/var/lib/apt/lists"):
nprefix="%s/%s" % (lists_d,mirror2lists_fileprefix(new_mirror))
if(oprefix==nprefix): return
olen=len(oprefix)
- for file in glob.glob("%s_*" % oprefix):
- os.rename(file,"%s%s" % (nprefix, file[olen:]))
+ for filename in glob.glob("%s_*" % oprefix):
+ os.rename(filename,"%s%s" % (nprefix, filename[olen:]))
def get_release():
stdout, _stderr = subprocess.Popen(['lsb_release', '-cs'], stdout=subprocess.PIPE).communicate()