diff --git a/src/fmu/sumo/explorer/explorer.py b/src/fmu/sumo/explorer/explorer.py index 92757591..9e677113 100644 --- a/src/fmu/sumo/explorer/explorer.py +++ b/src/fmu/sumo/explorer/explorer.py @@ -79,7 +79,7 @@ def get_permissions(self, asset: str = None): Returns: dict: Dictionary of user permissions """ - res = self._sumo.get("/userpermissions") + res = self._sumo.get("/userpermissions").json() if asset is not None: if asset not in res: @@ -97,6 +97,7 @@ async def get_permissions_async(self, asset: str = None): dict: Dictionary of user permissions """ res = await self._sumo.get_async("/userpermissions") + res = res.json() if asset is not None: if asset not in res: diff --git a/src/fmu/sumo/explorer/objects/_child.py b/src/fmu/sumo/explorer/objects/_child.py index dfe6e3b3..64173fa7 100644 --- a/src/fmu/sumo/explorer/objects/_child.py +++ b/src/fmu/sumo/explorer/objects/_child.py @@ -78,7 +78,7 @@ def blob(self) -> BytesIO: """Object blob""" if self._blob is None: res = self._sumo.get(f"/objects('{self.uuid}')/blob") - self._blob = BytesIO(res) + self._blob = BytesIO(res.content) return self._blob @@ -87,6 +87,6 @@ async def blob_async(self) -> BytesIO: """Object blob""" if self._blob is None: res = await self._sumo.get_async(f"/objects('{self.uuid}')/blob") - self._blob = BytesIO(res) + self._blob = BytesIO(res.content) return self._blob diff --git a/src/fmu/sumo/explorer/objects/cube.py b/src/fmu/sumo/explorer/objects/cube.py index 77d1a7c7..021d794e 100644 --- a/src/fmu/sumo/explorer/objects/cube.py +++ b/src/fmu/sumo/explorer/objects/cube.py @@ -31,22 +31,22 @@ def __init__(self, sumo: SumoClient, metadata: Dict) -> None: def _populate_url(self): res = self._sumo.get(f"/objects('{self.uuid}')/blob/authuri") try: - res = json.loads(res.decode("UTF-8")) + res = res.json() self._url = res.get("baseuri") + self.uuid self._sas = res.get("auth") except Exception: - self._url = res.decode("UTF-8") + self._url = res.text async def _populate_url_async(self): res = await self._sumo.get_async( f"/objects('{self.uuid}')/blob/authuri" ) try: - res = json.loads(res.decode("UTF-8")) + res = res.json() self._url = res.get("baseuri") + self.uuid self._sas = res.get("auth") except Exception: - self._url = res.decode("UTF-8") + self._url = res.text @property def url(self) -> str: diff --git a/src/fmu/sumo/explorer/objects/dictionary.py b/src/fmu/sumo/explorer/objects/dictionary.py index 9412d294..92f5b05d 100644 --- a/src/fmu/sumo/explorer/objects/dictionary.py +++ b/src/fmu/sumo/explorer/objects/dictionary.py @@ -25,7 +25,7 @@ def blob(self) -> bytes: """Object blob""" if self._blob is None: res = self._sumo.get(f"/objects('{self.uuid}')/blob") - self._blob = res + self._blob = res.content return self._blob