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.
Files changed (28) hide show
  1. {besapi-3.9.6/src/besapi.egg-info → besapi-3.9.7}/PKG-INFO +2 -1
  2. {besapi-3.9.6 → besapi-3.9.7}/setup.cfg +1 -0
  3. {besapi-3.9.6 → besapi-3.9.7}/src/besapi/besapi.py +10 -5
  4. {besapi-3.9.6 → besapi-3.9.7}/src/besapi/plugin_utilities.py +2 -0
  5. {besapi-3.9.6 → besapi-3.9.7/src/besapi.egg-info}/PKG-INFO +2 -1
  6. besapi-3.9.7/src/besapi.egg-info/requires.txt +7 -0
  7. {besapi-3.9.6 → besapi-3.9.7}/tests/test_plugin_utilities_logging.py +17 -0
  8. besapi-3.9.6/src/besapi.egg-info/requires.txt +0 -4
  9. {besapi-3.9.6 → besapi-3.9.7}/LICENSE.txt +0 -0
  10. {besapi-3.9.6 → besapi-3.9.7}/MANIFEST.in +0 -0
  11. {besapi-3.9.6 → besapi-3.9.7}/README.md +0 -0
  12. {besapi-3.9.6 → besapi-3.9.7}/pyproject.toml +0 -0
  13. {besapi-3.9.6 → besapi-3.9.7}/setup.py +0 -0
  14. {besapi-3.9.6 → besapi-3.9.7}/src/besapi/__init__.py +0 -0
  15. {besapi-3.9.6 → besapi-3.9.7}/src/besapi/__main__.py +0 -0
  16. {besapi-3.9.6 → besapi-3.9.7}/src/besapi/plugin_utilities_win.py +0 -0
  17. {besapi-3.9.6 → besapi-3.9.7}/src/besapi/schemas/BES.xsd +0 -0
  18. {besapi-3.9.6 → besapi-3.9.7}/src/besapi/schemas/BESAPI.xsd +0 -0
  19. {besapi-3.9.6 → besapi-3.9.7}/src/besapi/schemas/BESActionSettings.xsd +0 -0
  20. {besapi-3.9.6 → besapi-3.9.7}/src/besapi.egg-info/SOURCES.txt +0 -0
  21. {besapi-3.9.6 → besapi-3.9.7}/src/besapi.egg-info/dependency_links.txt +0 -0
  22. {besapi-3.9.6 → besapi-3.9.7}/src/besapi.egg-info/top_level.txt +0 -0
  23. {besapi-3.9.6 → besapi-3.9.7}/src/bescli/__init__.py +0 -0
  24. {besapi-3.9.6 → besapi-3.9.7}/src/bescli/__main__.py +0 -0
  25. {besapi-3.9.6 → besapi-3.9.7}/src/bescli/bescli.py +0 -0
  26. {besapi-3.9.6 → besapi-3.9.7}/tests/test_besapi.py +0 -0
  27. {besapi-3.9.6 → besapi-3.9.7}/tests/test_plugin_utilities.py +0 -0
  28. {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.6
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
@@ -33,6 +33,7 @@ install_requires =
33
33
  lxml
34
34
  requests
35
35
  setuptools
36
+ pywin32; platform_system == "Windows"
36
37
 
37
38
  [options.package_data]
38
39
  besapi = schemas/*.xsd
@@ -26,7 +26,7 @@ import lxml.etree
26
26
  import lxml.objectify
27
27
  import requests
28
28
 
29
- __version__ = "3.9.6"
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
- _ = self.post("operators", lxml.etree.tostring(xml_parsed))
742
- # print(user_result)
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
- _ = self.post(f"computergroups/{site_path}", lxml.etree.tostring(xml_parsed))
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
- # print("WARNING: Upload not found!")
804
+ logging.debug("WARNING: Upload not found!")
800
805
  return None
801
806
 
802
807
  return result
@@ -127,6 +127,8 @@ def get_plugin_logging_config(log_file_path="", verbose=0, console=True):
127
127
  )
128
128
  ]
129
129
 
130
+ logging.addLevelName(99, "SESSION")
131
+
130
132
  # log output to console if arg provided:
131
133
  if console:
132
134
  handlers.append(logging.StreamHandler())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: besapi
3
- Version: 3.9.6
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
@@ -0,0 +1,7 @@
1
+ cmd2
2
+ lxml
3
+ requests
4
+ setuptools
5
+
6
+ [:platform_system == "Windows"]
7
+ pywin32
@@ -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"
@@ -1,4 +0,0 @@
1
- cmd2
2
- lxml
3
- requests
4
- setuptools
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