Add descriptive error message to Linode inventory plugin file checkin… (#8133)

* Add descriptive error message to Linode inventory plugin file checking, tests

* add changelog fragment

* Adjust changelog fragment.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Gideon 2024-03-24 15:22:44 -06:00 committed by GitHub
parent 795a855d0e
commit b389f8637f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 7 deletions

View file

@ -37,11 +37,25 @@ def test_missing_access_token_lookup(inventory):
assert 'Could not retrieve Linode access token' in error_message
def test_verify_file(tmp_path, inventory):
def test_verify_file_yml(tmp_path, inventory):
file = tmp_path / "foobar.linode.yml"
file.touch()
assert inventory.verify_file(str(file)) is True
def test_verify_file_yaml(tmp_path, inventory):
file = tmp_path / "foobar.linode.yaml"
file.touch()
assert inventory.verify_file(str(file)) is True
def test_verify_file_bad_config_yml(inventory):
assert inventory.verify_file("foobar.linode.yml") is False
def test_verify_file_bad_config_yaml(inventory):
assert inventory.verify_file("foobar.linode.yaml") is False
def test_verify_file_bad_config(inventory):
assert inventory.verify_file('foobar.linode.yml') is False
assert inventory.verify_file("foobar.wrongcloud.yml") is False