Skip to content

Commit 9d7916b

Browse files
authored
Merge pull request #71 from MITLibraries/update-env-variable-name
Update OpenSearch endpoint ENV variable
2 parents 52bda73 + 6293891 commit 9d7916b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ TIMDEX! Index Manager (TIM) is a Python cli application for managing TIMDEX inde
99
## Optional ENV
1010

1111
- `AWS_REGION` = Only needed if AWS region changes from the default of us-east-1.
12-
- `OPENSEARCH_ENDPOINT` = If using a local Docker OpenSearch instance, this isn't needed. Otherwise set to OpenSearch instance endpoint _without_ the http scheme, e.g. `search-timdex-env-1234567890.us-east-1.es.amazonaws.com`. Can also be passed directly to the CLI via the `--url` option.
1312
- `OPENSEARCH_REQUEST_TIMEOUT` = Only used for OpenSearch requests that tend to take longer than the default timeout of 10 seconds, such as bulk or index refresh requests. Defaults to 30 seconds if not set.
1413
- `SENTRY_DSN` = If set to a valid Sentry DSN, enables Sentry exception monitoring. This is not needed for local development.
1514
- `STATUS_UPDATE_INTERVAL` = The ingest process logs the # of records indexed every nth record (1000 by default). Set this env variable to any integer to change the frequency of logging status updates. Can be useful for development/debugging.
15+
- `TIMDEX_OPENSEARCH_ENDPOINT` = If using a local Docker OpenSearch instance, this isn't needed. Otherwise set to OpenSearch instance endpoint _without_ the http scheme, e.g. `search-timdex-env-1234567890.us-east-1.es.amazonaws.com`. Can also be passed directly to the CLI via the `--url` option.
1616

1717
## Development
1818

@@ -37,5 +37,5 @@ To confirm the instance is up, run `pipenv run tim -u localhost ping`.
3737
### OpenSearch on AWS
3838

3939
1. Ensure that you have the correct AWS credentials set for the Dev1 (or desired) account.
40-
2. Set the `OPENSEARCH_ENDPOINT` variable in your .env to match the Dev1 (or desired) TIMDEX OpenSearch endpoint (note: do not include the http scheme prefix).
40+
2. Set the `TIMDEX_OPENSEARCH_ENDPOINT` variable in your .env to match the Dev1 (or desired) TIMDEX OpenSearch endpoint (note: do not include the http scheme prefix).
4141
3. Run `pipenv run tim ping` to confirm the client is connected to the expected TIMDEX OpenSearch instance.

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_env():
1818
"AWS_ACCESS_KEY_ID": "test",
1919
"AWS_SECRET_ACCESS_KEY": "test",
2020
"AWS_SESSION_TOKEN": "test",
21-
"OPENSEARCH_ENDPOINT": "localhost",
21+
"TIMDEX_OPENSEARCH_ENDPOINT": "localhost",
2222
"SENTRY_DSN": None,
2323
"WORKSPACE": "test",
2424
}

tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def escape_ansi(line):
1717
def test_main_group_no_options_configures_correctly_and_invokes_result_callback(
1818
caplog, monkeypatch, runner
1919
):
20-
monkeypatch.delenv("OPENSEARCH_ENDPOINT", raising=False)
20+
monkeypatch.delenv("TIMDEX_OPENSEARCH_ENDPOINT", raising=False)
2121
result = runner.invoke(main, ["ping"])
2222
assert result.exit_code == 0
2323
assert "Logger 'root' configured with level=INFO" in caplog.text
@@ -29,7 +29,7 @@ def test_main_group_no_options_configures_correctly_and_invokes_result_callback(
2929
def test_main_group_all_options_configures_correctly_and_invokes_result_callback(
3030
caplog, monkeypatch, runner
3131
):
32-
monkeypatch.delenv("OPENSEARCH_ENDPOINT", raising=False)
32+
monkeypatch.delenv("TIMDEX_OPENSEARCH_ENDPOINT", raising=False)
3333
result = runner.invoke(main, ["--verbose", "--url", "localhost", "ping"])
3434
assert result.exit_code == 0
3535
assert "Logger 'root' configured with level=DEBUG" in caplog.text

tim/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
@click.option(
3737
"-u",
3838
"--url",
39-
envvar="OPENSEARCH_ENDPOINT",
39+
envvar="TIMDEX_OPENSEARCH_ENDPOINT",
4040
default="localhost",
4141
help="The OpenSearch instance endpoint minus the http scheme, e.g. "
4242
"'search-timdex-env-1234567890.us-east-1.es.amazonaws.com'. If not provided, will "
43-
"attempt to get from the OPENSEARCH_ENDPOINT environment variable. Defaults to "
44-
"'localhost'.",
43+
"attempt to get from the TIMDEX_OPENSEARCH_ENDPOINT environment variable. Defaults "
44+
"to 'localhost'.",
4545
)
4646
@click.option(
4747
"-v", "--verbose", is_flag=True, help="Pass to log at debug level instead of info"

0 commit comments

Comments
 (0)