Skip to content

Commit

Permalink
Merge pull request #228 from lsst-sqre/tickets/DM-38425
Browse files Browse the repository at this point in the history
DM-38425: Be more robust when getting the running image
  • Loading branch information
rra authored Mar 24, 2023
2 parents 9d98985 + 1acf19d commit fc23c38
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Versioning follows [semver](https://semver.org/).

Dependencies are updated to the latest available version during each release. Those changes are not noted here explicitly.

## 5.0.1 (unreleased)

### Bug fixes

- The code to determine the Docker reference and description of the running Nublado image is now more robust against unexpected output.

## 5.0.0 (2023-03-22)

### Backwards-incompatible changes
Expand Down
12 changes: 9 additions & 3 deletions src/mobu/services/business/nublado.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,16 @@ async def create_session(
session = await self._client.create_labsession(notebook_name)
with self.timings.start("execute_setup", self.annotations()):
image_data = await self._client.run_python(session, _GET_IMAGE)
reference, description = image_data.strip().split("\n", 1)
if "\n" in image_data:
reference, description = image_data.split("\n", 1)
else:
msg = "Unable to get running image from reply"
self.logger.warning(msg, image_data=image_data)
reference = None
description = None
self._image = RunningImage(
reference=reference or None,
description=description or None,
reference=reference.strip() if reference else None,
description=description.strip() if description else None,
)
if self.options.get_node:
# Our libraries currently spew warning messages when imported.
Expand Down

0 comments on commit fc23c38

Please sign in to comment.