From 99d93e5570c763d283c625e219b18f273ac6e3a4 Mon Sep 17 00:00:00 2001 From: Daniel Chaffelson Date: Wed, 11 Nov 2020 11:51:37 +0000 Subject: [PATCH] Add refresh flag to canvas.update_processor. Fixes #198 --- nipyapi/canvas.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nipyapi/canvas.py b/nipyapi/canvas.py index f37226f1..8ba635de 100644 --- a/nipyapi/canvas.py +++ b/nipyapi/canvas.py @@ -751,7 +751,7 @@ def update_process_group(pg, update, refresh=True): ) -def update_processor(processor, update): +def update_processor(processor, update, refresh=True): """ Updates configuration parameters for a given Processor. @@ -761,6 +761,8 @@ def update_processor(processor, update): Args: processor (ProcessorEntity): The Processor to target for update update (ProcessorConfigDTO): The new configuration parameters + refresh (bool): Whether to refresh the Processor object state + before applying the update Returns: (ProcessorEntity): The updated ProcessorEntity @@ -771,6 +773,8 @@ def update_processor(processor, update): "update param is not an instance of nifi.ProcessorConfigDTO" ) with nipyapi.utils.rest_exceptions(): + if refresh: + processor = get_processor(processor.id, 'id') return nipyapi.nifi.ProcessorsApi().update_processor( id=processor.id, body=nipyapi.nifi.ProcessorEntity(