Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Custom logger as option in create_vManageSession (#136)
Browse files Browse the repository at this point in the history
* optional logger and bump

* fix
  • Loading branch information
tomaszwarda authored Mar 3, 2023
1 parent d94d823 commit cb8073e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "vmngclient"
version = "0.6.0"
version = "0.6.1"
description = "Universal vManage API"
authors = ["kagorski <[email protected]>"]
readme = "README.md"
Expand Down
4 changes: 4 additions & 0 deletions vmngclient/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def create_vManageSession(
password: str,
port: Optional[int] = None,
subdomain: Optional[str] = None,
logger: Optional[logging.Logger] = None
) -> vManageSession:
"""Factory function that creates session object based on provided arguments.
Expand All @@ -61,12 +62,15 @@ def create_vManageSession(
password (str): password
subdomain: subdomain specifying to which view switch when creating provider as a tenant session,
works only on provider user mode
logger: logger for logging API requests
Returns:
Session object
"""
session = vManageSession(url=url, username=username, password=password, port=port, subdomain=subdomain)
if logger:
session.logger = logger
session.auth = vManageAuth(session.base_url, username, password, verify=False)

if subdomain:
Expand Down

0 comments on commit cb8073e

Please sign in to comment.