Skip to content

Commit 8731bae

Browse files
authored
Merge pull request #389 from singularityhub/fix/docker-requirement-bug
docker: bug that docker is required for using podman
2 parents cf4e302 + f9a6831 commit 8731bae

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are:
1414
The versions coincide with releases on pip. Only major versions will be released as tags on Github.
1515

1616
## [0.0.x](https://github.scom/singularityhub/singularity-hpc/tree/master) (0.0.x)
17+
- Cleanup of module files and docker requirement bugfix (0.0.27)
1718
- Docker support (0.0.26)
1819
- added an enable_tty setting to allow disabling add -t in recipes
1920
- enforced not adding extra settings to setting.yml

shpc/main/container/docker.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ class DockerContainer(ContainerTechnology):
2525
features = {}
2626

2727
def __init__(self):
28-
if shpc.utils.which("docker")["return_code"] != 0:
29-
logger.exit("Docker is required to use the 'docker' base.")
28+
if shpc.utils.which(self.command)["return_code"] != 0:
29+
logger.exit(
30+
"%s is required to use the '%s' base."
31+
% (self.command.capitalize(), self.command)
32+
)
3033
super(DockerContainer, self).__init__()
3134

3235
def shell(self, image):

shpc/main/container/podman.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
__license__ = "MPL 2.0"
44

55

6-
from shpc.logger import logger
76
from .docker import DockerContainer
8-
import shpc.main.templates
9-
import shpc.utils
107

118
import os
129

@@ -20,11 +17,6 @@ class PodmanContainer(DockerContainer):
2017
templatefile = "docker"
2118
command = "podman"
2219

23-
def __init__(self):
24-
if shpc.utils.which("podman")["return_code"] != 0:
25-
logger.exit("podman is required to use the podman base.")
26-
super(PodmanContainer, self).__init__()
27-
2820
def shell(self, image):
2921
"""
3022
Interactive shell into a container image.

shpc/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
__copyright__ = "Copyright 2021, Vanessa Sochat"
33
__license__ = "MPL 2.0"
44

5-
__version__ = "0.0.26"
5+
__version__ = "0.0.27"
66
AUTHOR = "Vanessa Sochat"
77
NAME = "singularity-hpc"
88
PACKAGE_URL = "https://github.com/singularityhub/singularity-hpc"

0 commit comments

Comments
 (0)