mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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
95c1b07bdb
commit
64fe7402ff
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