summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorGonéri Le Bouder <goneri@lebouder.net>2020-03-25 13:44:10 -0400
committerGitHub <noreply@github.com>2020-03-25 13:44:10 -0400
commit993f3e3e76e56266a83776a8f54dbb3ba59cfce7 (patch)
treea7226ed8f85b6a8b09c14d923bc08aadf5a1c11b /cloudinit/util.py
parent42f69f410ab8850c02b1f53dd67c132aa8ef64f5 (diff)
downloadvyos-cloud-init-993f3e3e76e56266a83776a8f54dbb3ba59cfce7.tar.gz
vyos-cloud-init-993f3e3e76e56266a83776a8f54dbb3ba59cfce7.zip
set_passwords: avoid chpasswd on BSD (#268)
Avoid chpasswd on all the BSD variants.
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 89889459..db60b9d2 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -543,6 +543,11 @@ def is_ipv4(instr):
@lru_cache()
+def is_BSD():
+ return 'BSD' in platform.system()
+
+
+@lru_cache()
def is_FreeBSD():
return system_info()['variant'] == "freebsd"
@@ -625,7 +630,7 @@ def get_linux_distro():
flavor = match.groupdict()['codename']
if distro_name == 'rhel':
distro_name = 'redhat'
- elif 'BSD' in platform.system():
+ elif is_BSD():
distro_name = platform.system().lower()
distro_version = platform.release()
else: