Skip to content

Commit

Permalink
fix issue MrMino#19 - cannot handle empty hostname string
Browse files Browse the repository at this point in the history
  • Loading branch information
tompccs committed Jun 22, 2021
1 parent adc92aa commit bbc58c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dockernel/cli/install.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import secrets
import platform
import docker
from typing import List
Expand Down Expand Up @@ -56,7 +57,7 @@ def generate_kernelspec_argv(image_name: str, system_type: str) -> List[str]:
def image_digest(docker_client: docker.client.DockerClient,
image_name: str) -> str:
image = docker_client.images.get(image_name)
return image.attrs['ContainerConfig']['Hostname']
return image.attrs['ContainerConfig']['Hostname'] or secrets.token_hex(8)


def install(args: Namespace) -> int:
Expand Down

0 comments on commit bbc58c3

Please sign in to comment.