Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions cloudinit/distros/gentoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,23 +218,26 @@ def set_timezone(self, tz):
distros.set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz))

def package_command(self, command, args=None, pkgs=None):
if pkgs is None:
pkgs = []

cmd = list("emerge")
# Redirect output
cmd.append("--quiet")

if args and isinstance(args, str):
cmd.append(args)
elif args and isinstance(args, list):
cmd.extend(args)
if command == "upgrade":
cmd.extend(["--update", "world"])
else:
if pkgs is None:
pkgs = []

if args and isinstance(args, str):
cmd.append(args)
elif args and isinstance(args, list):
cmd.extend(args)

if command:
cmd.append(command)
if command:
cmd.append(command)

pkglist = util.expand_package_list("%s-%s", pkgs)
cmd.extend(pkglist)
pkglist = util.expand_package_list("%s-%s", pkgs)
cmd.extend(pkglist)

# Allow the output of this to flow outwards (ie not be captured)
subp.subp(cmd, capture=False)
Expand All @@ -243,7 +246,7 @@ def update_package_sources(self):
self._runner.run(
"update-sources",
self.package_command,
["-u", "world"],
["--sync"],
freq=PER_INSTANCE,
)

Expand Down