besapi 3.4.2__tar.gz → 3.7.1__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.4.2/src/besapi.egg-info → besapi-3.7.1}/PKG-INFO +2 -2
- {besapi-3.4.2 → besapi-3.7.1}/setup.cfg +1 -1
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi/besapi.py +1 -1
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi/plugin_utilities.py +12 -4
- {besapi-3.4.2 → besapi-3.7.1/src/besapi.egg-info}/PKG-INFO +2 -2
- {besapi-3.4.2 → besapi-3.7.1}/tests/tests.py +14 -2
- {besapi-3.4.2 → besapi-3.7.1}/LICENSE.txt +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/MANIFEST.in +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/README.md +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/pyproject.toml +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/setup.py +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi/__init__.py +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi/__main__.py +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi/schemas/BES.xsd +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi/schemas/BESAPI.xsd +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi/schemas/BESActionSettings.xsd +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi.egg-info/SOURCES.txt +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi.egg-info/dependency_links.txt +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi.egg-info/requires.txt +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/besapi.egg-info/top_level.txt +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/bescli/__init__.py +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/bescli/__main__.py +0 -0
- {besapi-3.4.2 → besapi-3.7.1}/src/bescli/bescli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: besapi
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.7.1
|
|
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
|
|
@@ -10,7 +10,7 @@ Keywords: bigfix iem tem rest api
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
-
Requires-Python: >=3.
|
|
13
|
+
Requires-Python: >=3.7
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE.txt
|
|
16
16
|
Requires-Dist: requests
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
"""This is a set of utility functions for use in multiple plugins
|
|
1
|
+
"""This is a set of utility functions for use in multiple plugins
|
|
2
|
+
|
|
3
|
+
see example here: https://github.com/jgstew/besapi/blob/master/examples/export_all_sites.py
|
|
4
|
+
"""
|
|
2
5
|
|
|
3
6
|
import argparse
|
|
4
7
|
import getpass
|
|
@@ -88,8 +91,10 @@ def setup_plugin_argparse(plugin_args_required=False):
|
|
|
88
91
|
return arg_parser
|
|
89
92
|
|
|
90
93
|
|
|
91
|
-
def
|
|
92
|
-
"""
|
|
94
|
+
def get_plugin_logging_config(log_file_path="", verbose=0, console=True):
|
|
95
|
+
"""get config for logging for plugin use
|
|
96
|
+
|
|
97
|
+
use this like: logging.basicConfig(**logging_config)"""
|
|
93
98
|
|
|
94
99
|
if not log_file_path or log_file_path == "":
|
|
95
100
|
log_file_path = os.path.join(
|
|
@@ -149,6 +154,8 @@ def get_besapi_connection(args):
|
|
|
149
154
|
# attempt bigfix connection with provided args:
|
|
150
155
|
if args.user and password:
|
|
151
156
|
try:
|
|
157
|
+
if not rest_url:
|
|
158
|
+
raise AttributeError
|
|
152
159
|
bes_conn = besapi.besapi.BESConnection(args.user, password, rest_url)
|
|
153
160
|
except (
|
|
154
161
|
AttributeError,
|
|
@@ -161,7 +168,8 @@ def get_besapi_connection(args):
|
|
|
161
168
|
args.besserver,
|
|
162
169
|
)
|
|
163
170
|
try:
|
|
164
|
-
|
|
171
|
+
if not args.besserver:
|
|
172
|
+
raise AttributeError
|
|
165
173
|
bes_conn = besapi.besapi.BESConnection(
|
|
166
174
|
args.user, password, args.besserver
|
|
167
175
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: besapi
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.7.1
|
|
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
|
|
@@ -10,7 +10,7 @@ Keywords: bigfix iem tem rest api
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
-
Requires-Python: >=3.
|
|
13
|
+
Requires-Python: >=3.7
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE.txt
|
|
16
16
|
Requires-Dist: requests
|
|
@@ -155,10 +155,22 @@ if bigfix_cli.bes_conn:
|
|
|
155
155
|
# test plugin_utilities:
|
|
156
156
|
print(besapi.plugin_utilities.get_invoke_folder())
|
|
157
157
|
print(besapi.plugin_utilities.get_invoke_file_name())
|
|
158
|
-
|
|
159
|
-
# besapi.plugin_utilities.setup_plugin_logging(console=True)
|
|
158
|
+
|
|
160
159
|
parser = besapi.plugin_utilities.setup_plugin_argparse(plugin_args_required=False)
|
|
161
160
|
# allow unknown args to be parsed instead of throwing an error:
|
|
162
161
|
args, _unknown = parser.parse_known_args()
|
|
163
162
|
|
|
163
|
+
# test logging plugin_utilities:
|
|
164
|
+
import logging
|
|
165
|
+
|
|
166
|
+
logging_config = besapi.plugin_utilities.get_plugin_logging_config("./tests.log")
|
|
167
|
+
|
|
168
|
+
# this use of logging.basicConfig requires python >= 3.9
|
|
169
|
+
if sys.version_info >= (3, 9):
|
|
170
|
+
logging.basicConfig(**logging_config)
|
|
171
|
+
|
|
172
|
+
logging.warning("Just testing to see if logging is working!")
|
|
173
|
+
|
|
174
|
+
assert os.path.isfile("./tests.log")
|
|
175
|
+
|
|
164
176
|
sys.exit(0)
|
|
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
|