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.
This commit is contained in:
Scott Moser 2012-03-19 13:33:39 -04:00
parent e43d9274be
commit b6617485e7

View File

@ -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'])