Module: check_mk
Branch: master
Commit: a967b1eb7fb731dec35ba34f4320e6f55ecdc211
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a967b1eb7fb731…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Mar 13 16:59:28 2017 +0100
4521 FIX mssql_versions: Fixed IndexError during inventory
Change-Id: I1ad703b18ceddc350200f610d2f2637c2602a779
---
.werks/4521 | 11 +++++++++++
inventory/mssql_versions | 5 ++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/4521 b/.werks/4521
new file mode 100644
index 0000000..66b2d42
--- /dev/null
+++ b/.werks/4521
@@ -0,0 +1,11 @@
+Title: mssql_versions: Fixed IndexError during inventory
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1489420731
+
+
diff --git a/inventory/mssql_versions b/inventory/mssql_versions
index 646aafa..b290aa6 100644
--- a/inventory/mssql_versions
+++ b/inventory/mssql_versions
@@ -67,7 +67,10 @@ def inv_mssql_versions(info):
if len(line) not in [2, 4]:
continue
- instance_id = line[0].split("_", 1)[1]
+ if "_" in line[0]:
+ instance_id = line[0].split("_", 1)[1]
+ else:
+ instance_id = line[0]
version = line[1]
edition = len(line) == 4 and line[2] or ""
clustered = len(line) == 4 and line[3] != ""