Skip to content

Commit e3f45b6

Browse files
Use relative imports for splunk-sdk
1 parent e2c5edd commit e3f45b6

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

splunklib/binding.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
from http import client
4040
from http.cookies import SimpleCookie
4141
from xml.etree.ElementTree import XML, ParseError
42-
from splunklib.data import record
43-
from splunklib import __version__
42+
from .data import record
43+
from . import __version__
4444

4545

4646
logger = logging.getLogger(__name__)

splunklib/client.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
from time import sleep
6969
from urllib import parse
7070

71-
from splunklib import data
72-
from splunklib.data import record
73-
from splunklib.binding import (AuthenticationError, Context, HTTPError, UrlEncoded,
71+
from . import data
72+
from .data import record
73+
from .binding import (AuthenticationError, Context, HTTPError, UrlEncoded,
7474
_encode, _make_cookie_header, _NoAuthenticationToken,
7575
namespace)
7676

@@ -3999,4 +3999,4 @@ def batch_save(self, *documents):
39993999
data = json.dumps(documents)
40004000

40014001
return json.loads(
4002-
self._post('batch_save', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8'))
4002+
self._post('batch_save', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8'))

splunklib/modularinput/event.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from io import TextIOBase
1616
import xml.etree.ElementTree as ET
1717

18-
from splunklib.utils import ensure_str
18+
from ..utils import ensure_str
1919

2020

2121
class Event:

splunklib/modularinput/event_writer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import sys
1616
import traceback
1717

18-
from splunklib.utils import ensure_str
18+
from ..utils import ensure_str
1919
from .event import ET
2020

2121

splunklib/searchcommands/search_command.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,8 @@
3434
from urllib.parse import urlsplit
3535
from warnings import warn
3636
from xml.etree import ElementTree
37-
from splunklib.utils import ensure_str
38-
3937

4038
# Relative imports
41-
import splunklib
4239
from . import Boolean, Option, environment
4340
from .internals import (
4441
CommandLineParser,
@@ -53,6 +50,7 @@
5350
RecordWriterV2,
5451
json_encode_string)
5552
from ..client import Service
53+
from ..utils import ensure_str
5654

5755

5856
# ----------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)