diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-03-07 16:27:47 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-03-07 16:27:47 -0500 |
commit | 3199df6e1489da03d51ac8a2a4574c27fd325189 (patch) | |
tree | 921700212c063d1b468a8ea2cac4f7df0f3a68d9 /cloudinit/distros/rhel.py | |
parent | 21aec9e44c27b9bf1c96314f0449fd39793d1c73 (diff) | |
parent | 8013c284e82349246b2274f5475c138323fd7c55 (diff) | |
download | vyos-cloud-init-3199df6e1489da03d51ac8a2a4574c27fd325189.tar.gz vyos-cloud-init-3199df6e1489da03d51ac8a2a4574c27fd325189.zip |
merge from trunk
Diffstat (limited to 'cloudinit/distros/rhel.py')
-rw-r--r-- | cloudinit/distros/rhel.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py index bc0877d5..9fee5fd1 100644 --- a/cloudinit/distros/rhel.py +++ b/cloudinit/distros/rhel.py @@ -60,9 +60,10 @@ class Distro(distros.Distro): # calls from repeatly happening (when they # should only happen say once per instance...) self._runner = helpers.Runners(paths) + self.osfamily = 'redhat' def install_packages(self, pkglist): - self.package_command('install', pkglist) + self.package_command('install', pkgs=pkglist) def _adjust_resolve(self, dns_servers, search_servers): try: @@ -207,7 +208,10 @@ class Distro(distros.Distro): # This ensures that the correct tz will be used for the system util.copy(tz_file, self.tz_local_fn) - def package_command(self, command, args=None): + def package_command(self, command, args=None, pkgs=None): + if pkgs is None: + pkgs = [] + cmd = ['yum'] # If enabled, then yum will be tolerant of errors on the command line # with regard to packages. @@ -218,9 +222,17 @@ class Distro(distros.Distro): # Determines whether or not yum prompts for confirmation # of critical actions. We don't want to prompt... cmd.append("-y") - cmd.append(command) - if args: + + if args and isinstance(args, str): + cmd.append(args) + elif args and isinstance(args, list): cmd.extend(args) + + cmd.append(command) + + pkglist = util.expand_package_list('%s-%s', pkgs) + cmd.extend(pkglist) + # Allow the output of this to flow outwards (ie not be captured) util.subp(cmd, capture=False) |