Skip to content

Please support custom fact gathering in connectors #1459

@goetzk

Description

@goetzk

(I asked this in pyinfra chat last month, this is me formally putting it on the radar)

Some remote endpoints which could be targetted by connectors provide their own entry point for certain facts that Pyinfra gathers.
It would be ideal if a connector developer could use those endpoints instead of accessing the remote system and invoking shell on them.

In my case I need to override files.File when the connector is in use but I suspect other facts will need similar treatment as I progress the connector; eg those related to resource measurement.

In chat it was suggested that "you could hook into the connect call and patch the facts though ... [it is] very hacky!". I hope we can find a non hacky solution :)

As a concrete example, LXD/Incus API requires commands passed in as a list, no white space allowed. Splitting that string around the already complex escaping in fact gathering has been.... Challenging.. However, the API has a call which reports if a file exists and it's vital stats. Being able to use that would make that slice of integration much easier.

https://linuxcontainers.org/incus/docs/main/rest-api-spec/#/instances/instance_files_head API doc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions