diff options
author | Rémy Léone <rleone@online.net> | 2018-03-01 18:23:32 +0100 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2018-03-02 12:53:26 -0500 |
commit | ffc6917aa0b97811c1e8503cd4cff9f11c15def1 (patch) | |
tree | bb2f58a42472a1d62cc9dfda544f7118a842b80a /cloudinit/distros | |
parent | 40e77380e036a24fafe91a63d0cdefada4312348 (diff) | |
download | vyos-cloud-init-ffc6917aa0b97811c1e8503cd4cff9f11c15def1.tar.gz vyos-cloud-init-ffc6917aa0b97811c1e8503cd4cff9f11c15def1.zip |
Change some list creation and population to literal.
This will provide a small performance improvement and shorter code.
Diffstat (limited to 'cloudinit/distros')
-rw-r--r-- | cloudinit/distros/arch.py | 5 | ||||
-rw-r--r-- | cloudinit/distros/opensuse.py | 5 |
2 files changed, 3 insertions, 7 deletions
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) |