How To clear cached entries from open field parameters

Overview

Here is some starter code to be able to clear out volume label parameter cached entries.

Use Case: These cached entries are collecting garbage information realtime, even before hitting the submit button, and then later those cached entries are overriding actual entries being submitted, adding things like spaces. End result is invalid entries getting through to our disk format action and failing builds

Consideration: The way listed below to delete those will be to delete those CustomFieldValues, so if any of those are in use they will be removed from the servers/resources they are on as well.

Procedure

(in shell_plus):

for cfv in CustomFieldValue.objects.filter(field=00): #replace 00 with the ID of the parameter
    cfv.delete()

You can also expand on this further and do a check if the cfv is on any active Servers to skip those and only delete cfvs not in use.



Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.