-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Fix verify_file check in Scaleway dynamic inventory #44384
Conversation
The test
|
with open(path) as f: | ||
raw_file = f.read() | ||
d = from_yaml(raw_file) | ||
return d.get("plugin") == "scaleway" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InventoryModule._read_config_data
perform the same things (reading the file, checking the plugin
key), I don't see any reason to no reusing it. I propose something like:
def verify_file(self, path):
if super(InventoryModule, self).verify_file(path):
try:
self._read_config_data(path)
return True
except Exception:
pass
return False
(comment edited: s/BaseInventoryFilePlugin/InventoryModule/
)
@pilou- Updated could you check again :) ? |
The test
|
@pilou- fixed the typo |
This pull request makes #43714 obsolete. |
Hum, it doesn't work because A simpler way is to completely remove the |
@pilou- Done |
shipit |
shipit |
shipit |
rebuild_merge |
SUMMARY
Fix verify_file check in Scaleway dynamic inventory
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION