@@ -46,7 +46,7 @@ def __init__(self):
46
46
47
47
def exists (self , module_name ):
48
48
"""
49
- A derivate of get to return boolean about container existence.
49
+ A derivative of get to return boolean about container existence.
50
50
"""
51
51
# This can be the module or container directory
52
52
container_dir = self .container_dir (module_name )
@@ -79,7 +79,7 @@ def add(self, module_name, image, config, container_yaml, **kwargs):
79
79
"""
80
80
Manually add a registry container, e.g., generating a container.yaml
81
81
for an existing container file. container_yaml is the destination file.
82
- If it's already exisitng , it's loaded into config. Otherwise we are
82
+ If it's already existing , it's loaded into config. Otherwise we are
83
83
using a template config.
84
84
"""
85
85
if ":" not in module_name :
@@ -89,7 +89,7 @@ def add(self, module_name, image, config, container_yaml, **kwargs):
89
89
90
90
# Cut out early if the tag isn't latest, and we already have it
91
91
# DO NOT call config.tags here, it will add an empty latest
92
- if tag != "latest" and tag in config ._config ["tags" ]:
92
+ if tag != "latest" and config . _config and tag in config ._config ["tags" ]:
93
93
if not utils .confirm_action (
94
94
"Tag %s already is defined, are you sure you want to overwrite it? "
95
95
% tag
@@ -116,6 +116,7 @@ def add(self, module_name, image, config, container_yaml, **kwargs):
116
116
"Registry entry %s was added! Before shpc install, edit:" % module_name
117
117
)
118
118
print (container_yaml )
119
+ return container_yaml
119
120
120
121
def _add_local_image (self , name , tag , image , config , container_yaml , ** kwargs ):
121
122
"""
@@ -380,7 +381,7 @@ def _pull_github(self, uri, dest=None):
380
381
repo = "/" .join (uri .split ("/" )[0 :2 ])
381
382
prefix = repo .replace ("/" , "-" )
382
383
383
- # The tag includes release and contianer tag (e.g., 0.0.1:latest)
384
+ # The tag includes release and container tag (e.g., 0.0.1:latest)
384
385
tag = uri .replace (repo , "" , 1 ).strip ("/" )
385
386
github_tag , container_tag = tag .split (":" , 1 )
386
387
0 commit comments