Giter Site home page Giter Site logo

Provisioning a new device via `equinix.metal.device` can sometimes succeed with 0 returned devices. about ansible-collection-metal HOT 2 OPEN

equinix avatar equinix commented on August 25, 2024
Provisioning a new device via `equinix.metal.device` can sometimes succeed with 0 returned devices.

from ansible-collection-metal.

Comments (2)

ischeinkman avatar ischeinkman commented on August 25, 2024 1

Actually, it looks like refresh_devices_list is correctly filtering the list of results to those matching the devices specified (by id).

Yes, that is true. What I was referring to was that refresh_devices_list only returns entries found in the list of results returned from module.get_devices(). If a devices passed in the initial devices list cannot be found in the return value of module.get_devices() then the function will not include an entry for that device ( as opposed to doing something like creating a Device object with a state of deleted/deprovisioned or something to that effect ).

Sorry that I wasn't clear!

from ansible-collection-metal.

displague avatar displague commented on August 25, 2024

Thanks for reporting this @ischeinkman.

by polling the results refresh_devices_list and checking that all devices returned match their requirements, but refresh_devices_list only returns devices visible from the API without checking to see if that includes all the device IDs passed as a parameter.

Actually, it looks like refresh_devices_list is correctly filtering the list of results to those matching the devices specified (by id).

The bug here is in the "all". As a vacuous truth the condition is met. We can add a len() check to ensure that the expected number of refreshed devices are found.

>>> if all(d == 1 for d in []):
...   print("yes")
... 
yes

from ansible-collection-metal.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.