Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-131128 / 25.04 / UI uses smart.test.query_for_disk with disk names, let it be that way #14547

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading