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/config/cc_ssh_authkey_fingerprints.py | |
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/config/cc_ssh_authkey_fingerprints.py')
-rwxr-xr-x | cloudinit/config/cc_ssh_authkey_fingerprints.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cloudinit/config/cc_ssh_authkey_fingerprints.py b/cloudinit/config/cc_ssh_authkey_fingerprints.py index 35d8c57f..98b0e665 100755 --- a/cloudinit/config/cc_ssh_authkey_fingerprints.py +++ b/cloudinit/config/cc_ssh_authkey_fingerprints.py @@ -77,11 +77,10 @@ def _pprint_key_entries(user, key_fn, key_entries, hash_meth='md5', tbl = SimpleTable(tbl_fields) for entry in key_entries: if _is_printable_key(entry): - row = [] - row.append(entry.keytype or '-') - row.append(_gen_fingerprint(entry.base64, hash_meth) or '-') - row.append(entry.options or '-') - row.append(entry.comment or '-') + row = [entry.keytype or '-', + _gen_fingerprint(entry.base64, hash_meth) or '-', + entry.options or '-', + entry.comment or '-'] tbl.add_row(row) authtbl_s = tbl.get_string() authtbl_lines = authtbl_s.splitlines() |