mirror of https://github.com/ansible/ansible.git
Fix classes that select a subclass based on platform (#17034)
When unittesting this we found that the platform selecting class hierarchies weren't working in all cases. If the subclass was directly created (ie: LinuxHardware()), then it would use its inherited __new__() to try to create itself. The inherited __new__ would look for subclasses and end up calling its own __new__() again. This would recurse endlessly. The new code detects when we want to find a subclass to create (when the base class is used, ie: Hardware()) vs when to create the class itself (when the subclass is used, ie: LinuxHardware()).pull/17052/head
parent
b82d150c42
commit
854d47826c
Loading…
Reference in New Issue