Skip to content

Commit aa6726e

Browse files
committed
DataSource: if public-keys is a string, split it on newline
Previously, we were returning an array with a single item, which could have contained newlines in it. This does limit the potential content of a ssh public key, but it seems unlikely that in the future a valid public key would contain a newline.
1 parent 6d8f796 commit aa6726e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cloudinit/DataSource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def get_public_ssh_keys(self):
7070
return([])
7171

7272
if isinstance(self.metadata['public-keys'], str):
73-
return([self.metadata['public-keys'], ])
73+
return(str(self.metadata['public-keys']).splitlines())
7474

7575
if isinstance(self.metadata['public-keys'], list):
7676
return(self.metadata['public-keys'])

0 commit comments

Comments
 (0)