Skip to content

Commit

Permalink
Bug fix (#20): pool_scrub_task would crash when given a nonexistent p…
Browse files Browse the repository at this point in the history
…ool name.
  • Loading branch information
arensb committed May 29, 2024
2 parents 2d9fc52 + 274881a commit c1cead1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,4 @@ or the latest [changelog.yaml](changelogs/changelog.yaml).
- Andrew Arensburger ([@arensb](https://mastodon.social/@arensb))
- Ed Hull (https://github.com/edhull)
- Mozzie (https://github.com/MozzieBytes)
- bmarinov (https://github.com/bmarinov)
9 changes: 9 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,12 @@ releases:
fragments:
- sharing-nfs.yml
release_date: '2024-05-17'
1.9.5:
changes:
bugfixes:
- The ``pool_scrub_task`` module would crash when invoked with a nonexistent
pool name. Fix contributed by bmarinov.
release_summary: bug fix
fragments:
- pool-scrub-json.yaml
release_date: '2024-05-29'
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace: arensb
name: truenas

# The version of the collection. Must be compatible with semantic versioning
version: 1.9.4
version: 1.9.5

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/pool_scrub_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ def main():
[["name", "=", pool]])
if len(pool_info) == 0:
# No such pool
module.json_fail(msg="Error: no such pool: {pool}")
module.fail_json(msg="Error: no such pool: {pool}")
else:
pool_info = pool_info[0]
except Exception as e:
module.json_fail(msg=f"Error looking up pool {pool}: {e}")
module.fail_json(msg=f"Error looking up pool {pool}: {e}")

arg['pool'] = pool_info['id']

Expand Down

0 comments on commit c1cead1

Please sign in to comment.