besapi 3.9.6__tar.gz → 3.9.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {besapi-3.9.6/src/besapi.egg-info → besapi-3.9.7}/PKG-INFO +2 -1
- {besapi-3.9.6 → besapi-3.9.7}/setup.cfg +1 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi/besapi.py +10 -5
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi/plugin_utilities.py +2 -0
- {besapi-3.9.6 → besapi-3.9.7/src/besapi.egg-info}/PKG-INFO +2 -1
- besapi-3.9.7/src/besapi.egg-info/requires.txt +7 -0
- {besapi-3.9.6 → besapi-3.9.7}/tests/test_plugin_utilities_logging.py +17 -0
- besapi-3.9.6/src/besapi.egg-info/requires.txt +0 -4
- {besapi-3.9.6 → besapi-3.9.7}/LICENSE.txt +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/MANIFEST.in +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/README.md +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/pyproject.toml +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/setup.py +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi/__init__.py +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi/__main__.py +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi/plugin_utilities_win.py +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi/schemas/BES.xsd +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi/schemas/BESAPI.xsd +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi/schemas/BESActionSettings.xsd +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi.egg-info/SOURCES.txt +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi.egg-info/dependency_links.txt +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/besapi.egg-info/top_level.txt +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/bescli/__init__.py +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/bescli/__main__.py +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/src/bescli/bescli.py +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/tests/test_besapi.py +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/tests/test_plugin_utilities.py +0 -0
- {besapi-3.9.6 → besapi-3.9.7}/tests/tests.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: besapi
|
|
3
|
-
Version: 3.9.
|
|
3
|
+
Version: 3.9.7
|
|
4
4
|
Summary: Library for working with the BigFix REST API
|
|
5
5
|
Home-page: https://github.com/jgstew/besapi
|
|
6
6
|
Author: Matt Hansen, James Stewart
|
|
@@ -24,6 +24,7 @@ Requires-Dist: cmd2
|
|
|
24
24
|
Requires-Dist: lxml
|
|
25
25
|
Requires-Dist: requests
|
|
26
26
|
Requires-Dist: setuptools
|
|
27
|
+
Requires-Dist: pywin32; platform_system == "Windows"
|
|
27
28
|
Dynamic: license-file
|
|
28
29
|
|
|
29
30
|
# besapi
|
|
@@ -26,7 +26,7 @@ import lxml.etree
|
|
|
26
26
|
import lxml.objectify
|
|
27
27
|
import requests
|
|
28
28
|
|
|
29
|
-
__version__ = "3.9.
|
|
29
|
+
__version__ = "3.9.7"
|
|
30
30
|
|
|
31
31
|
besapi_logger = logging.getLogger("besapi")
|
|
32
32
|
|
|
@@ -738,8 +738,9 @@ class BESConnection:
|
|
|
738
738
|
besapi_logger.warning("User `%s` Already Exists!", new_user_name)
|
|
739
739
|
return result_user
|
|
740
740
|
besapi_logger.info("Creating User `%s`", new_user_name)
|
|
741
|
-
|
|
742
|
-
|
|
741
|
+
user_result = self.post("operators", lxml.etree.tostring(xml_parsed))
|
|
742
|
+
logging.debug("user creation result:\n%s", user_result)
|
|
743
|
+
|
|
743
744
|
return self.get_user(new_user_name)
|
|
744
745
|
|
|
745
746
|
def get_computergroup(self, group_name, site_path=None):
|
|
@@ -771,7 +772,11 @@ class BESConnection:
|
|
|
771
772
|
|
|
772
773
|
# print(lxml.etree.tostring(xml_parsed))
|
|
773
774
|
|
|
774
|
-
|
|
775
|
+
create_group_result = self.post(
|
|
776
|
+
f"computergroups/{site_path}", lxml.etree.tostring(xml_parsed)
|
|
777
|
+
)
|
|
778
|
+
|
|
779
|
+
logging.debug("group creation result:\n%s", create_group_result)
|
|
775
780
|
|
|
776
781
|
return self.get_computergroup(site_path, new_group_name)
|
|
777
782
|
|
|
@@ -796,7 +801,7 @@ class BESConnection:
|
|
|
796
801
|
raise ValueError("No file_name specified. Must be at least one character.")
|
|
797
802
|
|
|
798
803
|
if "Upload not found" in result.text:
|
|
799
|
-
|
|
804
|
+
logging.debug("WARNING: Upload not found!")
|
|
800
805
|
return None
|
|
801
806
|
|
|
802
807
|
return result
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: besapi
|
|
3
|
-
Version: 3.9.
|
|
3
|
+
Version: 3.9.7
|
|
4
4
|
Summary: Library for working with the BigFix REST API
|
|
5
5
|
Home-page: https://github.com/jgstew/besapi
|
|
6
6
|
Author: Matt Hansen, James Stewart
|
|
@@ -24,6 +24,7 @@ Requires-Dist: cmd2
|
|
|
24
24
|
Requires-Dist: lxml
|
|
25
25
|
Requires-Dist: requests
|
|
26
26
|
Requires-Dist: setuptools
|
|
27
|
+
Requires-Dist: pywin32; platform_system == "Windows"
|
|
27
28
|
Dynamic: license-file
|
|
28
29
|
|
|
29
30
|
# besapi
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
|
+
import sys
|
|
3
4
|
import tempfile
|
|
4
5
|
|
|
5
6
|
import pytest
|
|
6
7
|
|
|
8
|
+
# Ensure the local `src/` is first on sys.path so tests import the workspace package
|
|
9
|
+
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
|
10
|
+
SRC = os.path.join(ROOT, "src")
|
|
11
|
+
if SRC not in sys.path:
|
|
12
|
+
sys.path.insert(0, SRC)
|
|
13
|
+
|
|
7
14
|
from besapi import plugin_utilities
|
|
8
15
|
|
|
9
16
|
|
|
@@ -59,3 +66,13 @@ def test_get_plugin_logging_config_debug_level(tmp_path):
|
|
|
59
66
|
|
|
60
67
|
# verbose>1 -> DEBUG
|
|
61
68
|
assert cfg.get("level") == logging.DEBUG
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def test_plugin_logging_config_registers_session_level(tmp_path):
|
|
72
|
+
"""Test that get_plugin_logging_config registers the custom SESSION log level
|
|
73
|
+
(99).
|
|
74
|
+
"""
|
|
75
|
+
log_file = tmp_path / "test_session.log"
|
|
76
|
+
plugin_utilities.get_plugin_logging_config(str(log_file), verbose=0, console=False)
|
|
77
|
+
# After calling, the level name for 99 should be 'SESSION'
|
|
78
|
+
assert logging.getLevelName(99) == "SESSION"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|