diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-06-29 20:06:32 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-06-29 20:06:32 -0400 |
commit | d95662579c59f8866721483e2b2c8b4ca0099eae (patch) | |
tree | a6be3eeba78db4fd063d933bd75acf27e5b2900f /cloudinit/distros/rhel.py | |
parent | cc23412d7a4841667179d70571689bb41a167d32 (diff) | |
download | vyos-cloud-init-d95662579c59f8866721483e2b2c8b4ca0099eae.tar.gz vyos-cloud-init-d95662579c59f8866721483e2b2c8b4ca0099eae.zip |
add update_package_sources to distro class
Previously update_package_sources was a private class
(_update_package_sources). The apt_update_upgrade class called it.
It does make sense that things would want to call this independently
of installing packages. Therefore, expose it as a non hidden method.
Diffstat (limited to 'cloudinit/distros/rhel.py')
-rw-r--r-- | cloudinit/distros/rhel.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py index 87d5b7a8..342d4c79 100644 --- a/cloudinit/distros/rhel.py +++ b/cloudinit/distros/rhel.py @@ -26,6 +26,8 @@ from cloudinit import distros from cloudinit import log as logging from cloudinit import util +from cloudinit.settings import PER_INSTANCE + LOG = logging.getLogger(__name__) NETWORK_FN_TPL = '/etc/sysconfig/network-scripts/ifcfg-%s' @@ -57,6 +59,10 @@ class Distro(distros.Distro): def __init__(self, name, cfg, paths): distros.Distro.__init__(self, name, cfg, paths) + # This will be used to restrict certain + # calls from repeatly happening (when they + # should only happen say once per instance...) + self._runner = helpers.Runners(paths) def install_packages(self, pkglist): self.package_command('install', pkglist) @@ -199,6 +205,10 @@ class Distro(distros.Distro): # Allow the output of this to flow outwards (ie not be captured) util.subp(cmd, capture=False) + def update_package_sources(self): + self._runner.run("update-sources", self.package_command, + ["update"], freq=PER_INSTANCE) + # This class helps adjust the configobj # writing to ensure that when writing a k/v |