Skip to content

Commit

Permalink
fix aws info loader
Browse files Browse the repository at this point in the history
  • Loading branch information
keijack committed Apr 25, 2021
1 parent eb1c588 commit 3b46083
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 39 deletions.
4 changes: 2 additions & 2 deletions py_eureka_client/__aws_info_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_ec2_metadata(self, meta_path, default_value=""):
_logger.warn(f"Cannot connect to amazon metadata services in address [{_AWS_METADATA_SERVICE_IP}], return default value. ")
return default_value
try:
return http_client.load(f"{_AWS_METADATA_SERVICE_URL}meta-data/{meta_path}")
return http_client.load(f"{_AWS_METADATA_SERVICE_URL}meta-data/{meta_path}")[0]
except Exception:
_logger.exception(f"error when loading metadata from aws {meta_path}")
return default_value
Expand All @@ -68,7 +68,7 @@ def get_instance_identity_document(self, default_value={}):
_logger.warn(f"Cannot connect to amazon metadata services in address [{_AWS_METADATA_SERVICE_IP}], return default value. ")
return default_value
try:
doc = http_client.load(f"{_AWS_METADATA_SERVICE_URL}dynamic/instance-identity/document")
doc = http_client.load(f"{_AWS_METADATA_SERVICE_URL}dynamic/instance-identity/document")[0]
return json.loads(doc)
except Exception:
_logger.exception("error when loading dynamic instance identity document from aws")
Expand Down
2 changes: 1 addition & 1 deletion py_eureka_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
SOFTWARE.
"""

version="0.9.7"
version="0.9.8"
36 changes: 0 additions & 36 deletions tests/py_eureka_client/net_int_test.py

This file was deleted.

0 comments on commit 3b46083

Please sign in to comment.