summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-08-22 14:36:02 -0400
committerScott Moser <smoser@ubuntu.com>2012-08-22 14:36:02 -0400
commitcb740b3018f55c21bda3a38b216d4ed61ab30d42 (patch)
tree74113e0fa5ecd8ec99bd4e4342bf127552c3e49f
parent0bc9f3aad55b6b1d50f80ef1b1688c2ceb1c8a84 (diff)
downloadvyos-cloud-init-cb740b3018f55c21bda3a38b216d4ed61ab30d42.tar.gz
vyos-cloud-init-cb740b3018f55c21bda3a38b216d4ed61ab30d42.zip
fix for pep8 issues and seemingly functional now.
-rw-r--r--cloudinit/config/cc_apt_update_upgrade.py9
-rw-r--r--cloudinit/distros/__init__.py2
2 files changed, 7 insertions, 4 deletions
diff --git a/cloudinit/config/cc_apt_update_upgrade.py b/cloudinit/config/cc_apt_update_upgrade.py
index 4b5f6a6d..49a93415 100644
--- a/cloudinit/config/cc_apt_update_upgrade.py
+++ b/cloudinit/config/cc_apt_update_upgrade.py
@@ -66,8 +66,8 @@ def handle(name, cfg, cloud, log, _args):
'apt_preserve_sources_list', False):
generate_sources_list(release, mirrors, cloud, log)
old_mirrors = cfg.get('apt_old_mirrors',
- old_mirrors = {"primary": "archive.ubuntu.com/ubuntu",
- "security": "security.ubuntu.com/ubuntu"})
+ {"primary": "archive.ubuntu.com/ubuntu",
+ "security": "security.ubuntu.com/ubuntu"})
rename_apt_lists(old_mirrors, mirrors)
# Set up any apt proxy
@@ -166,6 +166,7 @@ def rename_apt_lists(old_mirrors, new_mirrors, lists_d="/var/lib/apt/lists"):
for filename in glob.glob("%s_*" % oprefix):
util.rename(filename, "%s%s" % (nprefix, filename[olen:]))
+
def get_release():
(stdout, _stderr) = util.subp(['lsb_release', '-cs'])
return stdout.strip()
@@ -276,8 +277,8 @@ def find_apt_mirror_info(cloud, cfg):
mirror_list.append(mirrorfmt % (post))
mirror = util.search_for_mirror(mirror_list)
-
- mirror_info = cloud.get_package_mirror_info()
+
+ mirror_info = cloud.datasource.get_package_mirror_info()
# this is a bit strange.
# if mirror is set, then one of the legacy options above set it
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 62728a53..dce8fd06 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -209,6 +209,7 @@ def _get_package_mirror_info(mirror_info, availability_zone=None,
return results
+
def _get_arch_package_mirror_info(package_mirrors, arch):
# pull out the specific arch from a 'package_mirrors' config option
default = None
@@ -220,6 +221,7 @@ def _get_arch_package_mirror_info(package_mirrors, arch):
default = item
return default
+
def fetch(name):
locs = importer.find_module(name,
['', __name__],