X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/607fe087f6167061714a524dd53cbbc21b974973..6d1cb031f135b9b2bfd9262b08b7ab7650e8d92b:/sdk/python/arvados/commands/ws.py diff --git a/sdk/python/arvados/commands/ws.py b/sdk/python/arvados/commands/ws.py index aa7dd05b23..37dab55d60 100644 --- a/sdk/python/arvados/commands/ws.py +++ b/sdk/python/arvados/commands/ws.py @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + from __future__ import print_function import sys import logging @@ -46,9 +50,10 @@ def main(arguments=None): if "job" in components[c]: pipeline_jobs.add(components[c]["job"]["uuid"]) if known_component_jobs != pipeline_jobs: + new_filters = [['object_uuid', 'in', [args.pipeline] + list(pipeline_jobs)]] + ws.subscribe(new_filters) ws.unsubscribe(filters) - filters = [['object_uuid', 'in', [args.pipeline] + list(pipeline_jobs)]] - ws.subscribe([['object_uuid', 'in', [args.pipeline] + list(pipeline_jobs)]]) + filters = new_filters known_component_jobs = pipeline_jobs api = arvados.api('v1') @@ -84,7 +89,8 @@ def main(arguments=None): sys.stdout.write(ev["properties"]["text"]) elif ev["event_type"] in ("create", "update"): if ev["object_kind"] == "arvados#pipelineInstance": - update_subscribed_components(ev["properties"]["new_attributes"]["components"]) + c = api.pipeline_instances().get(uuid=ev["object_uuid"]).execute() + update_subscribed_components(c["components"]) if ev["object_kind"] == "arvados#pipelineInstance" and args.pipeline: if ev["properties"]["new_attributes"]["state"] in ("Complete", "Failed", "Paused"):