Skip to content

Commit

Permalink
feat: remove splunktaucclib
Browse files Browse the repository at this point in the history
  • Loading branch information
artemrys authored and Artem Rys committed Aug 9, 2021
1 parent e9e75c0 commit 661eb64
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 205 deletions.
181 changes: 2 additions & 179 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ wheel = "*"
dunamai = "*"
defusedxml = "^0.7.1"
jsonschema = "^3.2.0"
splunktaucclib = ">=5,<6"

[tool.poetry.dev-dependencies]
pytest = "^6.2"
Expand Down
2 changes: 0 additions & 2 deletions splunk_add_on_ucc_framework/uccrestbuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

import collections

from splunktaucclib.rest_handler.schema import RestSchema

from .builder import RestBuilder, RestBuilderError

__all__ = [
Expand Down
4 changes: 1 addition & 3 deletions splunk_add_on_ucc_framework/uccrestbuilder/endpoint/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#
from io import StringIO

from splunktaucclib.rest_handler.schema import RestSchema

__all__ = [
"RestEntityBuilder",
"RestEndpointBuilder",
Expand Down Expand Up @@ -109,7 +107,7 @@ def __init__(self, name, namespace, **kwargs):

@property
def name(self):
return RestSchema.endpoint_name(self._name, self._namespace)
return f"{self._namespace}_{self._name}"

@property
def namespace(self):
Expand Down
17 changes: 10 additions & 7 deletions splunk_add_on_ucc_framework/uccrestbuilder/endpoint/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ class RestFieldBuilder:
validator={validator}
)"""

def __init__(self, field, validator):
self._field = field
def __init__(self, name, required, encrypted, default, validator):
self._name = name
self._required = required
self._encrypted = encrypted
self._default = default
self._validator = validator

def generate_spec(self):
return self._kv_template.format(
name=self._field.name,
name=self._name,
value="",
)

Expand All @@ -45,9 +48,9 @@ def _indent_validator(self):

def generate_rh(self):
return self._rh_template.format(
name=quote_string(self._field.name),
required=self._field.required,
encrypted=self._field.encrypted,
default=quote_string(self._field.default),
name=quote_string(self._name),
required=self._required,
encrypted=self._encrypted,
default=quote_string(self._default),
validator=self._indent_validator(),
)
Loading

0 comments on commit 661eb64

Please sign in to comment.