Skip to content

Commit 89cb2b0

Browse files
fix(server_info): handle splunk not present imports
1 parent e204a3d commit 89cb2b0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

solnlib/server_info.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@
2020
import json
2121
from typing import Any, Dict, Optional
2222

23-
from splunk.rest import getWebCertFile, getWebKeyFile
23+
try:
24+
from splunk.rest import getWebCertFile, getWebKeyFile
25+
except (ModuleNotFoundError, ImportError):
26+
27+
def getWebCertFile():
28+
return None
29+
30+
def getWebKeyFile():
31+
return None
32+
33+
2434
from splunklib import binding
2535
from solnlib import splunk_rest_client as rest_client
2636
from solnlib import utils

0 commit comments

Comments
 (0)