@@ -46,7 +46,7 @@ def __init__(self):
4646
4747 def exists (self , module_name ):
4848 """
49- A derivate of get to return boolean about container existence.
49+ A derivative of get to return boolean about container existence.
5050 """
5151 # This can be the module or container directory
5252 container_dir = self .container_dir (module_name )
@@ -79,7 +79,7 @@ def add(self, module_name, image, config, container_yaml, **kwargs):
7979 """
8080 Manually add a registry container, e.g., generating a container.yaml
8181 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
8383 using a template config.
8484 """
8585 if ":" not in module_name :
@@ -89,7 +89,7 @@ def add(self, module_name, image, config, container_yaml, **kwargs):
8989
9090 # Cut out early if the tag isn't latest, and we already have it
9191 # 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" ]:
9393 if not utils .confirm_action (
9494 "Tag %s already is defined, are you sure you want to overwrite it? "
9595 % tag
@@ -116,6 +116,7 @@ def add(self, module_name, image, config, container_yaml, **kwargs):
116116 "Registry entry %s was added! Before shpc install, edit:" % module_name
117117 )
118118 print (container_yaml )
119+ return container_yaml
119120
120121 def _add_local_image (self , name , tag , image , config , container_yaml , ** kwargs ):
121122 """
@@ -380,7 +381,7 @@ def _pull_github(self, uri, dest=None):
380381 repo = "/" .join (uri .split ("/" )[0 :2 ])
381382 prefix = repo .replace ("/" , "-" )
382383
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)
384385 tag = uri .replace (repo , "" , 1 ).strip ("/" )
385386 github_tag , container_tag = tag .split (":" , 1 )
386387
0 commit comments