From ffc6917aa0b97811c1e8503cd4cff9f11c15def1 Mon Sep 17 00:00:00 2001 From: Rémy Léone Date: Thu, 1 Mar 2018 18:23:32 +0100 Subject: Change some list creation and population to literal. This will provide a small performance improvement and shorter code. --- cloudinit/distros/arch.py | 5 +---- cloudinit/distros/opensuse.py | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'cloudinit/distros') diff --git a/cloudinit/distros/arch.py b/cloudinit/distros/arch.py index f87a3432..b814c8ba 100644 --- a/cloudinit/distros/arch.py +++ b/cloudinit/distros/arch.py @@ -129,11 +129,8 @@ class Distro(distros.Distro): if pkgs is None: pkgs = [] - cmd = ['pacman'] + cmd = ['pacman', "-Sy", "--quiet", "--noconfirm"] # Redirect output - cmd.append("-Sy") - cmd.append("--quiet") - cmd.append("--noconfirm") if args and isinstance(args, str): cmd.append(args) diff --git a/cloudinit/distros/opensuse.py b/cloudinit/distros/opensuse.py index a219e9fb..162dfa05 100644 --- a/cloudinit/distros/opensuse.py +++ b/cloudinit/distros/opensuse.py @@ -67,11 +67,10 @@ class Distro(distros.Distro): if pkgs is None: pkgs = [] - cmd = ['zypper'] # No user interaction possible, enable non-interactive mode - cmd.append('--non-interactive') + cmd = ['zypper', '--non-interactive'] - # Comand is the operation, such as install + # Command is the operation, such as install if command == 'upgrade': command = 'update' cmd.append(command) -- cgit v1.2.3 From b389b196c834e4eaf9020952a92cd471ced599d2 Mon Sep 17 00:00:00 2001 From: Dominic Schlegel Date: Thu, 15 Mar 2018 12:47:42 -0400 Subject: FreeBSD: Set hostname to FQDN. FreeBSD requires the hostname to be set to FQDN. Previously the hostname just got set to short hostname (without FQDN part). Now cloud-init does set the hostname to the FQDN on FreeBSD hosts if a valid FQDN is given. LP: #1753499 --- cloudinit/distros/freebsd.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cloudinit/distros') diff --git a/cloudinit/distros/freebsd.py b/cloudinit/distros/freebsd.py index aa468bca..754d3df6 100644 --- a/cloudinit/distros/freebsd.py +++ b/cloudinit/distros/freebsd.py @@ -132,6 +132,12 @@ class Distro(distros.Distro): LOG.debug("Using network interface %s", bsddev) return bsddev + def _select_hostname(self, hostname, fqdn): + # Should be FQDN if available. See rc.conf(5) in FreeBSD + if fqdn: + return fqdn + return hostname + def _read_system_hostname(self): sys_hostname = self._read_hostname(filename=None) return ('rc.conf', sys_hostname) -- cgit v1.2.3