diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-22 23:36:08 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-22 23:36:08 -0700 |
commit | fdbd341aae7a41d3985e544fe40375087056b1f9 (patch) | |
tree | 1070e98bf315379f0b3fef2225cd6b56e15ab912 /cloudinit | |
parent | f8413af9168adc0ad7c730b9adea9eba67949ba5 (diff) | |
download | vyos-cloud-init-fdbd341aae7a41d3985e544fe40375087056b1f9.tar.gz vyos-cloud-init-fdbd341aae7a41d3985e544fe40375087056b1f9.zip |
Use os.path.join instead of custom string path formation
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/config/cc_apt_update_upgrade.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/config/cc_apt_update_upgrade.py b/cloudinit/config/cc_apt_update_upgrade.py index 8ecd9c94..42b6f3e9 100644 --- a/cloudinit/config/cc_apt_update_upgrade.py +++ b/cloudinit/config/cc_apt_update_upgrade.py @@ -133,7 +133,7 @@ def getkeybyid(keyid, keyserver): def mirror2lists_fileprefix(mirror): string = mirror - # take of http:// or ftp:// + # take off http:// or ftp:// if string.endswith("/"): string = string[0:-1] pos = string.find("://") @@ -144,8 +144,8 @@ def mirror2lists_fileprefix(mirror): def rename_apt_lists(omirror, new_mirror, lists_d="/var/lib/apt/lists"): - oprefix = "%s/%s" % (lists_d, mirror2lists_fileprefix(omirror)) - nprefix = "%s/%s" % (lists_d, mirror2lists_fileprefix(new_mirror)) + oprefix = os.path.join(lists_d, mirror2lists_fileprefix(omirror)) + nprefix = os.path.join(lists_d, mirror2lists_fileprefix(new_mirror)) if oprefix == nprefix: return olen = len(oprefix) |