Pull filesystems from dict in case is not string on eos_facts (#23254)

Apparently in some devices the filesystems gathering command can return
a dict containing a 'messages' key with the filesystems, instead of a
plain string.

Fixes #23217
pull/23290/head
Ricardo Carrillo Cruz 8 years ago
parent 08be1ae562
commit f0e19d8334

@ -201,6 +201,10 @@ class Hardware(FactsBase):
def populate_filesystems(self): def populate_filesystems(self):
data = self.responses[0] data = self.responses[0]
if isinstance(data, dict):
data = data['messages'][0]
fs = re.findall(r'^Directory of (.+)/', data, re.M) fs = re.findall(r'^Directory of (.+)/', data, re.M)
return dict(filesystems=fs) return dict(filesystems=fs)

Loading…
Cancel
Save