Skip to content

Commit

Permalink
removed the 'as_' conversion functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ndenny committed Sep 4, 2024
1 parent 2e77325 commit 37021a4
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions lib/Bastion/Site.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@
DEFAULT_LOGGING_PATH = pathlib.Path("/var/log/bastion")


def asLogLevel(x):
if isinstance(x, int):
return x
elif isinstance(x, str):
x = x.upper()
if x in ['DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL']:
return getattr(logging, x)
raise ValueError("asLogLevel - cannot interpret '{}' as a log level.".format(x))


def asPath(x):
return pathlib.Path(x)


class canConfigure:
"""
Trait for objects that can configure themselves from a nested dictionary.
Expand Down Expand Up @@ -75,7 +61,7 @@ def __init__(self, name):

self.logging = Thing()
self.logging.level = logging.WARN
self.logging.path = pathlib.Path("/var/log/bastion")
self.logging.path = pathlib.Path("/var/log/bastion/{}".format(self.name))
self.logging.persistence = None

self.policy = RetentionPolicy()
Expand Down

0 comments on commit 37021a4

Please sign in to comment.