Unverified Commit 4ac30999 authored by Volodymyr SAVCHENKO's avatar Volodymyr SAVCHENKO
Browse files

complain less

parent 75482ad9
......@@ -11,6 +11,7 @@ from nb2workflow.nbadapter import notebook_short_name, NotebookAdapter
import odacc
import re
logger = logging.getLogger(__name__)
class UnsetDict:
def __init__(self, data):
......@@ -81,7 +82,11 @@ def get(obj, path, default):
@click.pass_obj
def format(obj, template, notebook, from_env):
if from_env:
pars=ast.literal_eval(os.environ[from_env])
if from_env in os.environ:
pars=ast.literal_eval(os.environ[from_env])
else:
logger.warning("\033[31mERROR: parameters requested from env variable %s, but variable not set! Using default {}.\033[0m", from_env)
pars={}
elif notebook:
n = notebook_short_name(notebook)
nba = NotebookAdapter(notebook)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment