Skip to content

Allow --help without needing a connection to OpenSearch #4

@TibsAtWork

Description

@TibsAtWork

If I install all the requirements and run:

python ./search.py --help

without setting SERVICE_URI , I get

Update SERVICE_URI to your cluster uri. Current value for SERVICE_URI=https://user:pass@hostname:port

It's a nice error message, but I'd like to be able to find out the CLI syntax before deciding that I want to start a service.

At the moment, the module config.py ends with

client = OpenSearch(SERVICE_URI, use_ssl=True)

which tries to make the connection to OpenSearch immediately on import. I think it would be simpler to wrap that in a function and get the user to call it when needed.

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