Skip to content

Give a better error message when using an older/deprecated upcloud-sdk #4

@patrick-leb

Description

@patrick-leb

Edit: as per below, the problem was the SDK that was on version 1.0.1 when ~2.0 is required. This needs a better error message than crashing with the "unable to parse inventory" error.

======

I installed the collection with galaxy as instructed

My inventory file is:

plugin: community.upcloud.upcloud
tags:
  - swarm

my ansible.cfg is:

[default]
collections_paths = ~/.ansible/collections:/usr/share/ansible/collections

[inventory]
enable_plugins = community.upcloud.upcloud

Result:

ansible git:(main) ✗ ansible-inventory --list -i inventory/upcloud.yaml
[WARNING]:  * Failed to parse /Users/patrickleblanc/ansible/inventory/upcloud.yaml with ansible_collections.community.upcloud.plugins.inventory.upcloud plugin: 'str' object has no
attribute 'user_agent'
[WARNING]: Unable to parse /Users/patrickleblanc/ansible/inventory/upcloud.yaml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available

Any idea what I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions