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 8ea40dc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions netbox_cmdb/netbox_cmdb/protect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@


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 +24,11 @@ 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 8ea40dc

Please sign in to comment.