Skip to content

Commit 8c31544

Browse files
authored
DiscoveryClient - Add awareness of Discovery Service's Cluster ID environment variable (#242)
* Update DiscoveryClient to look for the NIDiscovery_ClusterId environment variable (used by the Discovery Service for initializing its cluster ID) to determine whether the key file exists to indicate an already launched Discovery Service. * Review feedback - use SNAKE_CASE for environment variable name Signed-off-by: Hunter Kennon hunter.kennon@emerson.com
1 parent f632506 commit 8c31544

File tree

1 file changed

+2
-1
lines changed
  • packages/ni.measurementlink.discovery.v1.client/src/ni/measurementlink/discovery/v1/client

1 file changed

+2
-1
lines changed

packages/ni.measurementlink.discovery.v1.client/src/ni/measurementlink/discovery/v1/client/_support.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131

3232

3333
def _get_discovery_service_address() -> str:
34-
key_file_path = _get_key_file_path()
34+
cluster_id = os.environ.get("NIDISCOVERY_CLUSTERID")
35+
key_file_path = _get_key_file_path(cluster_id)
3536
_ensure_discovery_service_started(key_file_path)
3637
_logger.debug("Discovery service key file path: %s", key_file_path)
3738
with _open_key_file(str(key_file_path)) as key_file:

0 commit comments

Comments
 (0)