Skip to content

Commit

Permalink
Fix edge case for middleware hostname override in asset.py (#1733)
Browse files Browse the repository at this point in the history
Fix middleware hostname override in asset.py and
asset_monitor.py
  • Loading branch information
Ashesh3 authored Nov 30, 2023
1 parent f287b46 commit cae1743
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion care/facility/api/viewsets/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ def operate_assets(self, request, *args, **kwargs):
middleware_hostname = (
asset.meta.get(
"middleware_hostname",
asset.current_location.middleware_address,
)
or asset.current_location.middleware_address
or asset.current_location.facility.middleware_address
)
asset_class: BaseAssetIntegration = AssetClasses[asset.asset_class].value(
Expand Down
2 changes: 1 addition & 1 deletion care/facility/tasks/asset_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def check_asset_status():
hostname = (
asset.meta.get(
"middleware_hostname",
asset.current_location.middleware_address,
)
or asset.current_location.middleware_address
or asset.current_location.facility.middleware_address
)
if not hostname:
Expand Down

0 comments on commit cae1743

Please sign in to comment.