Skip to content

Commit

Permalink
fix: Update code to allow next-available for h/w reservation id in …
Browse files Browse the repository at this point in the history
…metal_device module (#226)

Fixes #224 

A device that is not privisionable will fail when we try to provision on
it. Thus, removing the extra check of validation if a device is
provisionable or not allows us to pass `next-available` as the h/w
reservation id.
  • Loading branch information
omarkhan5299 committed Sep 20, 2024
1 parent 520e67d commit 46ee28e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions plugins/modules/metal_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,6 @@ def main():
operating_system = module.params.get("operating_system")
if (plan is None) or (operating_system is None):
raise Exception("plan and operating_system are required when creating a device")
if module.params.get("hardware_reservation_id"):
hw_res = module.get_hardware_reservation()
if hw_res["provisionable"] is False:
module.fail_json(
msg="Hardware reservation %s is not provisionable" % hw_res['id']
)
fetched = module.create("metal_device")
if "id" not in fetched:
raise Exception("UUID not found in device creation response")
Expand Down

0 comments on commit 46ee28e

Please sign in to comment.