Skip to content

Commit

Permalink
Use relative imports for splunk-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-s committed Feb 10, 2025
1 parent 1a3e290 commit e33d919
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions splunklib/binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
from http import client
from http.cookies import SimpleCookie
from xml.etree.ElementTree import XML, ParseError
from splunklib.data import record
from splunklib import __version__
from .data import record
from . import __version__


logger = logging.getLogger(__name__)
Expand Down
8 changes: 4 additions & 4 deletions splunklib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
from time import sleep
from urllib import parse

from splunklib import data
from splunklib.data import record
from splunklib.binding import (AuthenticationError, Context, HTTPError, UrlEncoded,
from . import data
from .data import record
from .binding import (AuthenticationError, Context, HTTPError, UrlEncoded,
_encode, _make_cookie_header, _NoAuthenticationToken,
namespace)

Expand Down Expand Up @@ -3999,4 +3999,4 @@ def batch_save(self, *documents):
data = json.dumps(documents)

return json.loads(
self._post('batch_save', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8'))
self._post('batch_save', headers=KVStoreCollectionData.JSON_HEADER, body=data).body.read().decode('utf-8'))
2 changes: 1 addition & 1 deletion splunklib/modularinput/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from io import TextIOBase
import xml.etree.ElementTree as ET

from splunklib.utils import ensure_str
from ..utils import ensure_str


class Event:
Expand Down
2 changes: 1 addition & 1 deletion splunklib/modularinput/event_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import sys
import traceback

from splunklib.utils import ensure_str
from ..utils import ensure_str
from .event import ET


Expand Down
4 changes: 1 addition & 3 deletions splunklib/searchcommands/search_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@
from urllib.parse import urlsplit
from warnings import warn
from xml.etree import ElementTree
from splunklib.utils import ensure_str


# Relative imports
import splunklib
from . import Boolean, Option, environment
from .internals import (
CommandLineParser,
Expand All @@ -53,6 +50,7 @@
RecordWriterV2,
json_encode_string)
from ..client import Service
from ..utils import ensure_str


# ----------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit e33d919

Please sign in to comment.