Skip to content

Commit

Permalink
docs(protect): docstring for device/ipam protection
Browse files Browse the repository at this point in the history
  • Loading branch information
kpetremann committed Oct 21, 2024
1 parent 493f08a commit c6995f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions netbox_cmdb/netbox_cmdb/protect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@


def from_device_name_change(*fields):
"""Protects from Device name changes in NetBox DCIM.
This is useful only to prevent Device name changes when CMDB is linked to it.
"""
def decorator(cls):
if cls not in MODELS_LINKED_TO_DEVICE:
MODELS_LINKED_TO_DEVICE[cls] = set()
Expand All @@ -19,6 +23,10 @@ def decorator(cls):


def from_ip_address_change(*fields):
"""Protects from IP Address "address" changes in NetBox IPAM.
This is useful only to prevent IP Address "address" changes when CMDB is linked to it.
"""
def decorator(cls):
if cls not in MODELS_LINKED_TO_IP_ADDRESS:
MODELS_LINKED_TO_IP_ADDRESS[cls] = set()
Expand Down

0 comments on commit c6995f1

Please sign in to comment.