mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00: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:
committed by
GitHub
parent
95c1b07bdb
commit
64fe7402ff
@@ -201,6 +201,10 @@ class Hardware(FactsBase):
|
||||
|
||||
def populate_filesystems(self):
|
||||
data = self.responses[0]
|
||||
|
||||
if isinstance(data, dict):
|
||||
data = data['messages'][0]
|
||||
|
||||
fs = re.findall(r'^Directory of (.+)/', data, re.M)
|
||||
return dict(filesystems=fs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user