summaryrefslogtreecommitdiff
path: root/cloudinit/DataSource.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-03-19 13:33:39 -0400
committerScott Moser <smoser@ubuntu.com>2012-03-19 13:33:39 -0400
commitaa6726ebd6c8499a7457a98000515b08f2f8f160 (patch)
treeaf0da2bf10c8d03b6cb01a590db5945857367490 /cloudinit/DataSource.py
parent6d8f796239ed635f2e4de97d167e54f74baba2a2 (diff)
downloadvyos-cloud-init-aa6726ebd6c8499a7457a98000515b08f2f8f160.tar.gz
vyos-cloud-init-aa6726ebd6c8499a7457a98000515b08f2f8f160.zip
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.
Diffstat (limited to 'cloudinit/DataSource.py')
-rw-r--r--cloudinit/DataSource.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloudinit/DataSource.py b/cloudinit/DataSource.py
index 1bcb9c10..e2a9150d 100644
--- a/cloudinit/DataSource.py
+++ b/cloudinit/DataSource.py
@@ -70,7 +70,7 @@ class DataSource:
return([])
if isinstance(self.metadata['public-keys'], str):
- return([self.metadata['public-keys'], ])
+ return(str(self.metadata['public-keys']).splitlines())
if isinstance(self.metadata['public-keys'], list):
return(self.metadata['public-keys'])