Chaffelson / nipyapi

A convenient Python wrapper for Apache NiFi
Other
246 stars 76 forks source link

Improving forceful delete_process_group #167

Closed rsaggino closed 4 years ago

rsaggino commented 4 years ago

Description

I noticed a few issues with the experimental forceful removal of PGs:

  1. The force option inside the delete_process_group function checks for connection inside the entire canvas (which could be slow). Applying list_all_connections() to the parent process group instead of the root PG seems to be a valid solution.
  2. list_all_controllers() seems to return duplicates, calling delete_controller() on an already deleted controller throws an error.
  3. This function is removing also the controllers at parent PG level.
rsaggino commented 4 years ago

The second point could be easily fixed in this way: `

        controllers_list=list(set(list_all_controllers(process_group.id)))
        for x in list_all_controllers(process_group.id):
            delete_controller(x, True)

`

Chaffelson commented 4 years ago

This is a terrible oversight on my part, I'll write some tests for reproduction next week. Thanks for letting me know!

On Fri, 13 Dec 2019, 15:18 rsaggino, notifications@github.com wrote:

The second point could be easily fixed in this way: `

    controllers_list=list(set(list_all_controllers(process_group.id)))
    for x in list_all_controllers(process_group.id):
        delete_controller(x, True)

`

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Chaffelson/nipyapi/issues/167?email_source=notifications&email_token=ACZAZOB7HP5MONQDCH5M7TTQYOKSVA5CNFSM4J2KRHU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG2DAFY#issuecomment-565456919, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZAZOB5DXISOUJ2EM2RWS3QYOKSVANCNFSM4J2KRHUQ .