From 5049450fc6ed457b642b94e14fe49180d8c21d0d Mon Sep 17 00:00:00 2001 From: Josie Fegan Date: Mon, 12 Jan 2026 12:35:14 +0000 Subject: [PATCH] SNMP integrations are different We have found in the field that SBMP integrations do not have an "integration" key in them and thus cause the existing code here to break. Fix that by adding a special case for it. --- samples/integration_list.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/samples/integration_list.py b/samples/integration_list.py index 8ac1250..0a07bea 100755 --- a/samples/integration_list.py +++ b/samples/integration_list.py @@ -22,6 +22,8 @@ import opsramp.binding +LOG = logging.getLogger(__name__) + def connect(): url = os.environ["OPSRAMP_URL"] @@ -53,10 +55,16 @@ def main(): found = group.search() for idata in found["results"]: in_auth, out_auth = group.auth_type(idata) + if "integration" in idata: + intg_id = idata["integration"]["id"] + else: + intg_id = None print( idata["id"], + "category", + idata["category"], "type", - idata["integration"]["id"], + intg_id, "in_auth", in_auth, "out_auth",