Set a default image name if none is provided

It's kind of shitty but better than just erroring.
pull/6/head
yuvipanda 2017-05-22 22:16:30 -07:00
rodzic a7d85c48fc
commit 657db33017
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -6,6 +6,7 @@ import logging
import uuid
import shutil
from pythonjsonlogger import jsonlogger
import escapism
from traitlets.config import Application, LoggingConfigurable
@ -126,6 +127,12 @@ class Repo2Docker(Application):
self.log.setLevel(logging.INFO)
self.load_config_file(self.config_file)
if self.output_image_spec is None:
# Attempt to set a sane default!
# HACK: Provide something more descriptive?
self.output_image_spec = escapism.escape(self.repo).lower() + ':' + self.ref.lower()
def run(self):
# HACK: Try to just pull this and see if that works.
# if it does, then just bail.