Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge staging into prod #47

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions app/stac/services/blob_mounting/blob_mapping_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@
load_dotenv()
from blob_mounting_helper_utility import BlobMappingUtility

_blob_mounting_configurations_json_path = os.getenv("BLOB_MOUNTING_CONFIGURATIONS_JSON_PATH",
os.path.join(os.path.dirname(os.path.realpath(__file__)),
'blob_mounting_configurations.json'))
_blob_mounting_configurations_json_path = os.getenv("BLOB_MOUNTING_CONFIGURATIONS_JSON_PATH")

_AZURE_STORAGE_ACCOUNT_KEY = os.getenv("AZURE_STORAGE_ACCOUNT_KEY", None)

with open(_blob_mounting_configurations_json_path) as json_file:
blob_mounting_configurations_list: List[Dict[str, Any]] = json.load(json_file)["blob_mounting_configurations"]
blob_mapping_utility: BlobMappingUtility = BlobMappingUtility(blob_mounting_configurations_list,
_AZURE_STORAGE_ACCOUNT_KEY)
if _blob_mounting_configurations_json_path is not None:
with open(_blob_mounting_configurations_json_path) as json_file:
blob_mounting_configurations_list: List[Dict[str, Any]] = json.load(json_file)["blob_mounting_configurations"]
blob_mapping_utility: BlobMappingUtility = BlobMappingUtility(blob_mounting_configurations_list,
_AZURE_STORAGE_ACCOUNT_KEY)

logging.info(f"Using {_blob_mounting_configurations_json_path} for blob mounting configurations")
logging.info(f"Using {_blob_mounting_configurations_json_path} for blob mounting configurations")
else:
blob_mapping_utility: BlobMappingUtility = {}
4 changes: 2 additions & 2 deletions app/stac/services/stac_item_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ def _add_assets(self):
asset_key = return_asset_name(filename)
media_type = get_file_type(file)
if asset_key.lower() == "rendered_preview":
asset = Asset(href=file, media_type=media_type, roles=["overview"],
asset = Asset(href=file.split('?')[0], media_type=media_type, roles=["overview"],
extra_fields={"rel": "preview", "title": "Rendered preview"})
else:
asset = Asset(href=file, media_type=media_type)
asset = Asset(href=file.split('?')[0], media_type=media_type)
self.item.add_asset(key=asset_key, asset=asset)
logger.info(f"Added assets to STAC item")

Expand Down