Skip to content

Commit

Permalink
adjust cot logging for less verbosity and more clarity
Browse files Browse the repository at this point in the history
We can likely make more improvements here, but this is a start.
  • Loading branch information
escapewindow committed Mar 28, 2019
1 parent cee8b2e commit 9ee4faf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
12 changes: 2 additions & 10 deletions scriptworker/cot/verify.py
Expand Up @@ -1302,9 +1302,6 @@ async def populate_jsone_context(chain, parent_link, decision_link, tasks_for):
else:
raise CoTError("Unknown tasks_for {}!".format(tasks_for))

log.debug("{} json-e context:".format(parent_link.name))
# format_json() breaks on lambda values; use pprint.pformat here.
log.debug(pprint.pformat(jsone_context))
return jsone_context


Expand Down Expand Up @@ -2011,14 +2008,13 @@ def get_source_url(obj):
"""
source_env_prefix = obj.context.config['source_env_prefix']
task = obj.task
log.debug("Getting source url for {} {}...".format(obj.name, obj.task_id))
repo = get_repo(obj.task, source_env_prefix=source_env_prefix)
source = task['metadata']['source']
if repo and not verify_repo_matches_url(repo, source):
raise CoTError("{name} {task_id}: {source_env_prefix} {repo} doesn't match source {source}!".format(
name=obj.name, task_id=obj.task_id, source_env_prefix=source_env_prefix, repo=repo, source=source
))
log.info("{} {}: found {}".format(obj.name, obj.task_id, source))
log.info("%s %s source url %s", obj.name, obj.task_id, source)
return source


Expand Down Expand Up @@ -2144,7 +2140,7 @@ async def verify_chain_of_trust(chain):
raise
else:
raise CoTError(str(exc))
log.info("Good.")
log.info("taskId %s passes chain of trust verification.", chain.task_id)


# verify_cot_cmdln {{{1
Expand All @@ -2166,10 +2162,6 @@ async def _async_verify_cot_cmdln(opts, tmp):
context.config = apply_product_config(context.config)
cot = ChainOfTrust(context, opts.task_type, task_id=opts.task_id)
await verify_chain_of_trust(cot)
log.info(format_json(cot.dependent_task_ids()))
log.info("{} : {}".format(cot.name, cot.task_id))
for link in cot.links:
log.info("{} : {}".format(link.name, link.task_id))


def verify_cot_cmdln(args=None, event_loop=None):
Expand Down
1 change: 0 additions & 1 deletion scriptworker/utils.py
Expand Up @@ -566,7 +566,6 @@ async def download_file(context, url, abs_filename, session=None, chunk_size=128
if not chunk:
break
fd.write(chunk)
log.info("Done")


# get_loggable_url {{{1
Expand Down

0 comments on commit 9ee4faf

Please sign in to comment.