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
This commit is contained in:
parent
08be1ae562
commit
f0e19d8334
1 changed files with 4 additions and 0 deletions
|
@ -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…
Reference in a new issue