summaryrefslogtreecommitdiff
path: root/cloudinit/distros/bsd.py
diff options
context:
space:
mode:
authorGonéri Le Bouder <goneri@lebouder.net>2020-05-04 16:58:35 -0400
committerGitHub <noreply@github.com>2020-05-04 14:58:35 -0600
commitf9b393bb4f15258de230884949e543e0f62f9abb (patch)
tree1993e292c7ebe7f659fe53b6798a7aee603766f5 /cloudinit/distros/bsd.py
parent59dd290ee7986f76247bfd26d18cbcc586777812 (diff)
downloadvyos-cloud-init-f9b393bb4f15258de230884949e543e0f62f9abb.tar.gz
vyos-cloud-init-f9b393bb4f15258de230884949e543e0f62f9abb.zip
bsd: upgrade support (#305)
Implement the upgrade support: - FreeBSD: using `pkg upgrade` - NetBSD: with `pkgin`
Diffstat (limited to 'cloudinit/distros/bsd.py')
-rw-r--r--cloudinit/distros/bsd.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/cloudinit/distros/bsd.py b/cloudinit/distros/bsd.py
index efc73d5d..37cf93bf 100644
--- a/cloudinit/distros/bsd.py
+++ b/cloudinit/distros/bsd.py
@@ -18,9 +18,9 @@ class BSD(distros.Distro):
group_add_cmd_prefix = []
pkg_cmd_install_prefix = []
pkg_cmd_remove_prefix = []
- # There is no need to update the package cache on NetBSD and OpenBSD
- # TODO neither freebsd nor netbsd handles a command 'upgrade'
+ # There is no update/upgrade on OpenBSD
pkg_cmd_update_prefix = None
+ pkg_cmd_upgrade_prefix = None
def __init__(self, name, cfg, paths):
super().__init__(name, cfg, paths)
@@ -97,6 +97,10 @@ class BSD(distros.Distro):
if not self.pkg_cmd_update_prefix:
return
cmd = self.pkg_cmd_update_prefix
+ elif command == 'upgrade':
+ if not self.pkg_cmd_upgrade_prefix:
+ return
+ cmd = self.pkg_cmd_upgrade_prefix
if args and isinstance(args, str):
cmd.append(args)