Skip to content

Commit

Permalink
UI uses smart.test.query_for_disk with disk names, let it be that w…
Browse files Browse the repository at this point in the history
…ay (#14547)
  • Loading branch information
themylogin committed Sep 20, 2024
1 parent 98ff997 commit b082771
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/middlewared/middlewared/plugins/smart.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,16 @@ async def _validate(self, data, id_=None):
return verrors

@accepts(Str('disk'), roles=['REPORTING_READ'])
async def query_for_disk(self, disk):
async def query_for_disk(self, disk_name):
"""
Query S.M.A.R.T. tests for the specified disk.
Query S.M.A.R.T. tests for the specified disk name.
"""
disk = await self.middleware.call_sync('disk.query', [['name', '=', disk_name]], {'get': True})

return [
test
for test in await self.query()
if test['all_disks'] or disk in test['disks']
if test['all_disks'] or disk['identifier'] in test['disks']
]

@accepts(Bool('full_disk', default=False))
Expand Down

0 comments on commit b082771

Please sign in to comment.