Skip to content

Commit

Permalink
Add refresh flag to canvas.update_processor. Fixes #198
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaffelson committed Nov 11, 2020
1 parent 011f49a commit 99d93e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nipyapi/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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(
Expand Down

0 comments on commit 99d93e5

Please sign in to comment.