holado 0.9.1__py3-none-any.whl → 0.9.2__py3-none-any.whl
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.
Potentially problematic release.
This version of holado might be problematic. Click here for more details.
- holado/__init__.py +26 -5
- holado/common/context/session_context.py +4 -2
- holado/holado_config.py +0 -3
- {holado-0.9.1.dist-info → holado-0.9.2.dist-info}/METADATA +1 -1
- {holado-0.9.1.dist-info → holado-0.9.2.dist-info}/RECORD +16 -16
- holado_grpc/__init__.py +8 -0
- holado_helper/holado_module_template/__init__.py +7 -0
- holado_logging/__init__.py +8 -4
- holado_logging/common/logging/log_config.py +13 -4
- holado_python/__init__.py +1 -0
- holado_python/common/tools/datetime.py +2 -1
- holado_report/__init__.py +6 -0
- holado_rest/__init__.py +8 -0
- holado_test/test_server/client/rest/test_server_client.py +10 -2
- {holado-0.9.1.dist-info → holado-0.9.2.dist-info}/WHEEL +0 -0
- {holado-0.9.1.dist-info → holado-0.9.2.dist-info}/licenses/LICENSE +0 -0
holado/__init__.py
CHANGED
|
@@ -38,13 +38,14 @@ def __initialize_holado_loggers():
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def _initialize_logging(use_holado_logger=True, logging_config_file_path=None, log_level=None, log_on_console=False, log_in_file=True):
|
|
41
|
+
def _initialize_logging(use_holado_logger=True, logging_config_file_path=None, log_level=None, log_time_in_utc=None, log_on_console=False, log_in_file=True):
|
|
42
42
|
# print_imported_modules("[initialize]")
|
|
43
43
|
import holado_logging
|
|
44
44
|
# print_imported_modules("[after import holado_logging]")
|
|
45
45
|
|
|
46
46
|
# Configure logging module
|
|
47
|
-
holado_logging.configure(use_holado_logger=use_holado_logger, logging_config_file_path=logging_config_file_path,
|
|
47
|
+
holado_logging.configure(use_holado_logger=use_holado_logger, logging_config_file_path=logging_config_file_path,
|
|
48
|
+
log_level=log_level, log_time_in_utc=log_time_in_utc, log_on_console=log_on_console, log_in_file=log_in_file)
|
|
48
49
|
# print_imported_modules("[after import holado_logging]")
|
|
49
50
|
|
|
50
51
|
# Initialize holado loggers
|
|
@@ -77,11 +78,11 @@ def initialize_minimal():
|
|
|
77
78
|
# session_kwargs={'with_session_path':False},
|
|
78
79
|
# garbage_collector_periodicity=None)
|
|
79
80
|
initialize(TSessionContext=None, use_holado_logger=True, logging_config_file_path=None,
|
|
80
|
-
log_level=None, log_on_console=True, log_in_file=False,
|
|
81
|
+
log_level=None, log_time_in_utc=None, log_on_console=True, log_in_file=False,
|
|
81
82
|
garbage_collector_periodicity=None)
|
|
82
83
|
|
|
83
84
|
def initialize(TSessionContext=None, use_holado_logger=True, logging_config_file_path=None,
|
|
84
|
-
log_level=None, log_on_console=False, log_in_file=True, session_kwargs=None,
|
|
85
|
+
log_level=None, log_time_in_utc=None, log_on_console=False, log_in_file=True, session_kwargs=None,
|
|
85
86
|
garbage_collector_periodicity=default_value):
|
|
86
87
|
global __initialized
|
|
87
88
|
if __initialized:
|
|
@@ -108,7 +109,7 @@ def initialize(TSessionContext=None, use_holado_logger=True, logging_config_file
|
|
|
108
109
|
|
|
109
110
|
# Initialize logging
|
|
110
111
|
_initialize_logging(use_holado_logger=use_holado_logger, logging_config_file_path=logging_config_file_path,
|
|
111
|
-
log_level=log_level, log_on_console=log_on_console, log_in_file=log_in_file and with_session_path)
|
|
112
|
+
log_level=log_level, log_time_in_utc=log_time_in_utc, log_on_console=log_on_console, log_in_file=log_in_file and with_session_path)
|
|
112
113
|
if Tools.do_log(logger, logging.DEBUG):
|
|
113
114
|
logger.debug("Configured logging")
|
|
114
115
|
|
|
@@ -181,6 +182,7 @@ def _import_modules(module_names):
|
|
|
181
182
|
from holado_core.common.tools.tools import Tools
|
|
182
183
|
|
|
183
184
|
imported_modules = __import_modules(module_names)
|
|
185
|
+
__configure_modules(imported_modules)
|
|
184
186
|
remaining_imported_modules = __register_modules_with_dependencies(imported_modules)
|
|
185
187
|
|
|
186
188
|
# Register modules with cross dependencies
|
|
@@ -217,6 +219,25 @@ def __import_modules(module_names):
|
|
|
217
219
|
res[module_name] = module
|
|
218
220
|
return res
|
|
219
221
|
|
|
222
|
+
def __configure_modules(imported_modules):
|
|
223
|
+
from holado_core.common.tools.tools import Tools
|
|
224
|
+
|
|
225
|
+
if Tools.do_log(logger, logging.DEBUG):
|
|
226
|
+
logger.debug(f"Configuring imported HolAdo modules: {sorted(imported_modules.keys())}")
|
|
227
|
+
|
|
228
|
+
imported_module_names = list(imported_modules.keys())
|
|
229
|
+
for module_name in imported_module_names:
|
|
230
|
+
if Tools.do_log(logger, logging.TRACE): # @UndefinedVariable
|
|
231
|
+
logger.trace(f"Configuring HolAdo module '{module_name}'...")
|
|
232
|
+
module = imported_modules[module_name]
|
|
233
|
+
if hasattr(module, 'configure_module'):
|
|
234
|
+
module.configure_module()
|
|
235
|
+
if Tools.do_log(logger, logging.DEBUG):
|
|
236
|
+
logger.debug(f"Configured HolAdo module '{module_name}'")
|
|
237
|
+
else:
|
|
238
|
+
if Tools.do_log(logger, logging.DEBUG):
|
|
239
|
+
logger.debug(f"Nothing to configure for HolAdo module '{module_name}'")
|
|
240
|
+
|
|
220
241
|
def __register_modules_with_dependencies(imported_modules):
|
|
221
242
|
from holado_core.common.tools.tools import Tools
|
|
222
243
|
|
|
@@ -18,7 +18,7 @@ from holado.common.context.context import Context
|
|
|
18
18
|
from holado_core.common.tools.tools import Tools
|
|
19
19
|
import threading
|
|
20
20
|
from holado.common.handlers.enums import ObjectStates
|
|
21
|
-
from
|
|
21
|
+
from holado.holado_config import Config
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
logger = logging
|
|
@@ -147,11 +147,13 @@ class SessionContext(Context):
|
|
|
147
147
|
return None
|
|
148
148
|
|
|
149
149
|
def new_session(self, session_kwargs=None):
|
|
150
|
+
from holado_python.common.tools.datetime import DateTime
|
|
151
|
+
|
|
150
152
|
# Report session
|
|
151
153
|
report_path = None
|
|
152
154
|
if self.with_session_path:
|
|
153
155
|
# Create new report path for this session
|
|
154
|
-
name = "session_{}".format(DateTime.now().strftime("%Y-%m-%d_%H-%M-%S"))
|
|
156
|
+
name = "session_{}".format(DateTime.now(tz=Config.report_timezone).strftime("%Y-%m-%d_%H-%M-%S")) # @UndefinedVariable
|
|
155
157
|
report_path = self.path_manager.get_reports_path(name)
|
|
156
158
|
logger.info(f"Reports location: {report_path}")
|
|
157
159
|
print(f"Reports location: {report_path}")
|
holado/holado_config.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
holado/__init__.py,sha256=
|
|
2
|
-
holado/holado_config.py,sha256=
|
|
1
|
+
holado/__init__.py,sha256=VUOUKhp-7JRRdYwwXGhuAK0IxqWCDxjPSo6j_Y4vfvA,16011
|
|
2
|
+
holado/holado_config.py,sha256=dZADu2J87H0mtCBFURZVebLGihn_JNSAsNQtH9vq_e8,2479
|
|
3
3
|
holado/common/__init__.py,sha256=ZjXM-FRQgnfzRNXqcvJOGewDHVRR-U5-ugStSs8U2Xs,1525
|
|
4
4
|
holado/common/context/__init__.py,sha256=3jJBLm8myrYF9jbdV1EhIA6BtnlmjX33eeoDpTzwmLA,1604
|
|
5
5
|
holado/common/context/context.py,sha256=MV8A6JSpUcTcfia_QzjyDLybQC50rZ-NA0ffotnHXQY,11994
|
|
6
6
|
holado/common/context/service_manager.py,sha256=LaCn8ukE1aqJynmwoexAYj5hCkdb_F3hXRtUBGqorUE,14087
|
|
7
|
-
holado/common/context/session_context.py,sha256=
|
|
7
|
+
holado/common/context/session_context.py,sha256=dw4ozOn3o7EZwyfa_luMXLis5BO1z2HpmP91-GFKZLc,23391
|
|
8
8
|
holado/common/handlers/__init__.py,sha256=d0KDUpaAAw1eBXyX08gaRh4RECnJlXjYQ0TcU-Ndicc,1372
|
|
9
9
|
holado/common/handlers/enums.py,sha256=ieqKVoukEiNyfE3KrKmMOImdbFS1ocUMud8JHe2xNLs,1662
|
|
10
10
|
holado/common/handlers/object.py,sha256=rDaav8zHTYfKVEaLtEdeXMxYXATGVcs2a7um1f5MvCs,7205
|
|
@@ -255,7 +255,7 @@ holado_examples/tests/behave/testing_solution/src/context/session_context.py,sha
|
|
|
255
255
|
holado_examples/tests/behave/testing_solution/steps/config_steps.py,sha256=sToZrs7kFQMs7NPK_n3fsO2jXHHPH4d0rBSZnBe85S4,535
|
|
256
256
|
holado_examples/tests/behave/testing_solution/steps/public_steps.py,sha256=nnxgBjFMpuQ9xVAAxma0lRwLz8VrbTZuF61vRkKKafA,252
|
|
257
257
|
holado_grpc/TODO,sha256=ESjES2-J6-3AJYdt6olcz_YGt4YTxw80CjIt-tjJ0z4,206
|
|
258
|
-
holado_grpc/__init__.py,sha256=
|
|
258
|
+
holado_grpc/__init__.py,sha256=Ci8_IsOk5Ki7ToZB8uhy03cHd9Eth7Rgr1fi8BxiM9s,2429
|
|
259
259
|
holado_grpc/api/rpc/TODO.txt,sha256=uWZT-WtrGuWbiOVU8-6xNiNyx_kKx-htM691zprLjh0,130
|
|
260
260
|
holado_grpc/api/rpc/grpc_client.py,sha256=7j6DOdrkAXZpas2hsIOSr-kkOEZNhw9hAAluHY8m3BE,10433
|
|
261
261
|
holado_grpc/api/rpc/grpc_manager.py,sha256=v3e7b1JCNlUoCnWUPgB9aWKde-AbseRCZAxFwz5gPN8,4115
|
|
@@ -274,7 +274,7 @@ holado_helper/docker/init_user.sh,sha256=vac-OUgsbSTIuO7MK4mpbtRZNGqHbNJGNm3Hk3W
|
|
|
274
274
|
holado_helper/docker/logging.conf,sha256=PKFEwVhQriaaHZMnU3t5I9fGxuM1HFxUBRJ0NZVH-KE,1186
|
|
275
275
|
holado_helper/docker/run_holado_test_nonreg_in_docker.sh,sha256=-wxyfHu2rVh1lEmyI6v0PercfzfyoMZ6Ww2FIA0Dse0,4694
|
|
276
276
|
holado_helper/docker/run_terminal_in_docker.sh,sha256=paKLNcUfJ5Uc0qWW3DFQInitbX8zbGDcPsCE65zywFA,3395
|
|
277
|
-
holado_helper/holado_module_template/__init__.py,sha256=
|
|
277
|
+
holado_helper/holado_module_template/__init__.py,sha256=JzUm55NIkeBynu1RieZ3QfZGw8v4NfFDzz6HS-bN7r8,1798
|
|
278
278
|
holado_helper/holado_module_template/tests/behave/steps/__init__.py,sha256=BHp8TYE_X4lWn4B8A51nXSYaJlczuiDVJLcKMy7p0Lw,1267
|
|
279
279
|
holado_helper/holado_module_template/tests/behave/steps/private/__init__.py,sha256=BHp8TYE_X4lWn4B8A51nXSYaJlczuiDVJLcKMy7p0Lw,1267
|
|
280
280
|
holado_helper/script/action.py,sha256=YPLS-3Ot-bti9d6VxilW5PwfYCU64hFd1qK1d2XepFY,6187
|
|
@@ -299,9 +299,9 @@ holado_keycloak/tests/behave/steps/__init__.py,sha256=NBE4L-am7jgPiJxcHRlZ4PQRjJ
|
|
|
299
299
|
holado_keycloak/tests/behave/steps/tools/keycloak_client_steps.py,sha256=Dc1xB3qtUcBNwdlTsMS8z_9oG9yyePEJSI0MZQ_3jac,3026
|
|
300
300
|
holado_keycloak/tools/keycloak/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
301
301
|
holado_keycloak/tools/keycloak/keycloak_client.py,sha256=QXAsf9rF0pKq1dHhXeZFZOxuEg_1uzp6vqXnwWDnegg,4019
|
|
302
|
-
holado_logging/__init__.py,sha256=
|
|
302
|
+
holado_logging/__init__.py,sha256=erlTOOiI7SVryt3P6X3F2cEvdXflD85su8faAsTMN1Y,2259
|
|
303
303
|
holado_logging/common/logging/holado_logger.py,sha256=FB5J_YbG41FGljAywMdCPVFJ2BdpMBS8AWPsT9B52S8,3160
|
|
304
|
-
holado_logging/common/logging/log_config.py,sha256=
|
|
304
|
+
holado_logging/common/logging/log_config.py,sha256=u6Ax3S1TdBAzeUD3DAcw5WXPYEJeiQie7T_x_K6ZKeo,7049
|
|
305
305
|
holado_logging/common/logging/log_manager.py,sha256=gq92IAfnKEX-GKUHexNVgEI0UUrUdiWaC5GLcSTAaUE,13604
|
|
306
306
|
holado_multitask/__init__.py,sha256=EwuwiBmp8ICbPZ8CKPju8tHRTh2rG68PB_wGXczY9rw,2143
|
|
307
307
|
holado_multitask/multiprocessing/function_process.py,sha256=HFXjpnzWed5J1tjmWMQyRx8AGcY6D1laegHqZ5j1dco,4550
|
|
@@ -337,10 +337,10 @@ holado_protobuf/ipc/protobuf/types/google/__init__.py,sha256=47DEQpj8HBSa-_TImW-
|
|
|
337
337
|
holado_protobuf/ipc/protobuf/types/google/protobuf.py,sha256=8vlpyreY0pzt-rUZTI0bDmkyH91_oFiAwQvmZPvBaQs,5331
|
|
338
338
|
holado_protobuf/tests/behave/steps/__init__.py,sha256=y2cb2NXe15g8sBts6vB3SicDEUy7XvY0bZbhUiY7Qnk,1280
|
|
339
339
|
holado_protobuf/tests/behave/steps/ipc/protobuf_steps.py,sha256=Pbw5E-AbTTSKR_i_JXxSkq922F2oFML3rsCF8ILSqXA,17136
|
|
340
|
-
holado_python/__init__.py,sha256=
|
|
340
|
+
holado_python/__init__.py,sha256=DuWuDU7MxVsAOz1G6TiYRRsIhApFWMNNwA8Xwp0LhtU,1658
|
|
341
341
|
holado_python/common/enums.py,sha256=iwffWOqUdiFaOn83RPmjRVVHakTjQve55sNsbY4x8Ek,1535
|
|
342
342
|
holado_python/common/iterables.py,sha256=p5X6h18W-GSnZ4WHt5Y5g3Ri4TB4B5i5NhyAwb7g1Ww,2064
|
|
343
|
-
holado_python/common/tools/datetime.py,sha256=
|
|
343
|
+
holado_python/common/tools/datetime.py,sha256=h6dcKnBikFH5V2EK688zG6poeLPhXYdudiITsraG2aI,13453
|
|
344
344
|
holado_python/common/tools/comparators/boolean_comparator.py,sha256=66AtqQ1u7NLTKAmgZHdnbE8vMPfgwJ2ZrzMiea90jX0,2042
|
|
345
345
|
holado_python/common/tools/comparators/bytes_comparator.py,sha256=VKD5Q734n1k5Q0zX14fYgvM-66ysyRWkjo2fLgleyt0,2412
|
|
346
346
|
holado_python/common/tools/comparators/datetime_comparator.py,sha256=6smSvQ7ErnNuBNHkSbkf4HoSUJU54DNS2ILhxM1FHAk,3487
|
|
@@ -391,7 +391,7 @@ holado_redis/tests/behave/steps/tools/redis_client_steps.py,sha256=lOh0YlumJcszt
|
|
|
391
391
|
holado_redis/tools/redis/TODO.txt,sha256=cmFyx6qS6_FgL1Ph0OWRsWch6MQaklfv1j0qBO2ZpZU,202
|
|
392
392
|
holado_redis/tools/redis/redis_client.py,sha256=KWuOrnwTcwt5xkD3rtI_l07v164Y_bsoo1kE0IGzqaQ,8316
|
|
393
393
|
holado_redis/tools/redis/redis_manager.py,sha256=tMO0XrCZTCfGdByFfgWXk9R-I_TUPLO9wXMQf8yCYcQ,1814
|
|
394
|
-
holado_report/__init__.py,sha256=
|
|
394
|
+
holado_report/__init__.py,sha256=3wtu5g9d4d-AICmLZclPQrw2MS-FJL9CyiVO1n2MYWA,1868
|
|
395
395
|
holado_report/campaign/campaign_manager.py,sha256=Py5aAGc-6rJb1FlDsUJ7EwyrGy0DBEXLPTJzR7yBMe8,8693
|
|
396
396
|
holado_report/report/execution_historic.py,sha256=M4lYoZwyrSivRa17Q39GOAgROnr0oBvIZX5BNcO5Mnc,6951
|
|
397
397
|
holado_report/report/report_manager.py,sha256=VOA9ABV3DAGf5Q5_eNPVJ3oJndiZSXGI8SKg6uP-Sq0,14713
|
|
@@ -408,7 +408,7 @@ holado_report/report/builders/summary_scenario_report_builder.py,sha256=OaHfZitX
|
|
|
408
408
|
holado_report/report/reports/base_report.py,sha256=NGnWe66uyvT4bCjhd3upwVpc6yQ2gyVNFhcy-3LeQsE,6850
|
|
409
409
|
holado_report/report/reports/feature_report.py,sha256=i0wpk3LQLArVjWDsP9UcNSJzAUWwLhe73HNyfye2gYQ,4810
|
|
410
410
|
holado_report/report/reports/scenario_report.py,sha256=eMyqw9EzaKMmX3pGFJN1rqAOQ5eqO2ISZdxAfK3XQR4,2945
|
|
411
|
-
holado_rest/__init__.py,sha256=
|
|
411
|
+
holado_rest/__init__.py,sha256=2_byOZEIrNQIBgRxurCZ9eyMkddAuW4IuhLXMI2j4bk,1689
|
|
412
412
|
holado_rest/api/rest/TODO.txt,sha256=Oz8BYPkBEs9OAEgyYLLm7i5tJ1bRE5POBpT3SRFWTi4,29
|
|
413
413
|
holado_rest/api/rest/rest_client.py,sha256=VHVzKKY_7QRiTUScAUIzFM-W4lbHFKnNBA09gxCnQ-E,9609
|
|
414
414
|
holado_rest/api/rest/rest_manager.py,sha256=XldPjNgj73GlzAmlsEcQYaHiDRk7SGU6VEFOLBnHjQM,4010
|
|
@@ -502,7 +502,7 @@ holado_test/common/context/step_context.py,sha256=jknJVU0OrzRaqlTJyhwBFjr9uKPe1d
|
|
|
502
502
|
holado_test/common/exceptions/undefined_step_exception.py,sha256=SHHX22iz4Ip-V4Y3aM2EJFDt30CCS5EaauN6KB-JORo,1461
|
|
503
503
|
holado_test/scenario/step_tools.py,sha256=iNay6tQPUi4sG-a8PY5LbbLpX0PRakkOj3ls98aEbHM,26375
|
|
504
504
|
holado_test/scenario/tester_tools.py,sha256=Tv035FyXPjQ46Ep8KuPOjOvzJFvxnbv9EsrSihUzAwg,2479
|
|
505
|
-
holado_test/test_server/client/rest/test_server_client.py,sha256=
|
|
505
|
+
holado_test/test_server/client/rest/test_server_client.py,sha256=WJG-_FLSg1YuRXUBX-5RXd-97XEnUv1UfTvyvQnXLo4,5317
|
|
506
506
|
holado_test/test_server/server/Dockerfile,sha256=TR_xUU2YLmKYWeGUaRRZRhaBHKHa4Y_1nqQDquK843w,1744
|
|
507
507
|
holado_test/test_server/server/requirements.txt,sha256=c2iNG9IZZogAEC9oSWRTWEF9-OHW0vRtijPNK4P6_xY,45
|
|
508
508
|
holado_test/test_server/server/run_test_server_in_docker.sh,sha256=ISNvFT1dBM6aiw5Iv6yBhInn7L8ZYyz_7EDK_X1eCvk,3121
|
|
@@ -670,7 +670,7 @@ test_holado/tools/django/api_rest/api_rest/api1/serializers.py,sha256=o_YxFr-tgC
|
|
|
670
670
|
test_holado/tools/django/api_rest/api_rest/api1/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
|
671
671
|
test_holado/tools/django/api_rest/api_rest/api1/views.py,sha256=kOt2xT6bxO47_z__5yYR9kcYIWWv4qYzpX0K8Tqonik,758
|
|
672
672
|
test_holado/tools/django/api_rest/api_rest/api1/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
673
|
-
holado-0.9.
|
|
674
|
-
holado-0.9.
|
|
675
|
-
holado-0.9.
|
|
676
|
-
holado-0.9.
|
|
673
|
+
holado-0.9.2.dist-info/METADATA,sha256=vA1oSCS6qTSa1UE3CREU1Y6T4gbutfdPrHVpFJy3ANA,7671
|
|
674
|
+
holado-0.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
675
|
+
holado-0.9.2.dist-info/licenses/LICENSE,sha256=IgGmNlcFHnbp7UWrLJqAFvs_HIgjJDTmjCNRircJLsk,1070
|
|
676
|
+
holado-0.9.2.dist-info/RECORD,,
|
holado_grpc/__init__.py
CHANGED
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
# The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
|
|
13
13
|
#################################################
|
|
14
14
|
|
|
15
|
+
import logging
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def configure_module():
|
|
19
|
+
from holado.holado_config import Config
|
|
20
|
+
|
|
21
|
+
# Default log level
|
|
22
|
+
Config.log_level_grpc_request = logging.INFO
|
|
15
23
|
|
|
16
24
|
def dependencies():
|
|
17
25
|
return ["holado_multitask", "holado_protobuf"]
|
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
#################################################
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
def configure_module():
|
|
17
|
+
"""
|
|
18
|
+
Configure this module
|
|
19
|
+
Example: set new attributes in holado.holado_config.Config class
|
|
20
|
+
"""
|
|
21
|
+
pass
|
|
22
|
+
|
|
16
23
|
def dependencies():
|
|
17
24
|
"""
|
|
18
25
|
Return None or the list of names of modules it depend on
|
holado_logging/__init__.py
CHANGED
|
@@ -14,13 +14,17 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
from holado_logging.common.logging.log_config import LogConfig
|
|
19
|
-
LogConfig.configure(use_holado_logger=use_holado_logger, config_file_path=logging_config_file_path, log_level=log_level, log_on_console=log_on_console, log_in_file=log_in_file)
|
|
20
|
-
|
|
17
|
+
|
|
21
18
|
def dependencies():
|
|
22
19
|
return None
|
|
23
20
|
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def configure(use_holado_logger=True, logging_config_file_path=None, log_level=None, log_time_in_utc=None, log_on_console=False, log_in_file=True):
|
|
24
|
+
from holado_logging.common.logging.log_config import LogConfig
|
|
25
|
+
LogConfig.configure(use_holado_logger=use_holado_logger, config_file_path=logging_config_file_path,
|
|
26
|
+
log_level=log_level, log_time_in_utc=log_time_in_utc, log_on_console=log_on_console, log_in_file=log_in_file)
|
|
27
|
+
|
|
24
28
|
def initialize_and_register():
|
|
25
29
|
from holado.common.context.session_context import SessionContext
|
|
26
30
|
from holado_logging.common.logging.log_manager import LogManager
|
|
@@ -22,12 +22,13 @@ class LogConfig(object):
|
|
|
22
22
|
TManager = None
|
|
23
23
|
config_file_path = None
|
|
24
24
|
default_level = logging.INFO
|
|
25
|
+
log_time_in_utc = True
|
|
25
26
|
log_on_console=False
|
|
26
27
|
log_in_file=True
|
|
27
28
|
__is_configured = False
|
|
28
29
|
|
|
29
30
|
@classmethod
|
|
30
|
-
def configure(cls, use_holado_logger=True, config_file_path=None, log_level=None, log_on_console=False, log_in_file=True):
|
|
31
|
+
def configure(cls, use_holado_logger=True, config_file_path=None, log_level=None, log_time_in_utc=None, log_on_console=False, log_in_file=True):
|
|
31
32
|
if cls.__is_configured:
|
|
32
33
|
logging.warning(f"Logging was already configured, it is not possible to configure it twice. This new configuration is skipped.")
|
|
33
34
|
return
|
|
@@ -45,14 +46,17 @@ class LogConfig(object):
|
|
|
45
46
|
import configparser
|
|
46
47
|
config = configparser.ConfigParser()
|
|
47
48
|
config.read(config_file_path)
|
|
48
|
-
log_level = config.get("holado", "level")
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
log_level = config.get("holado", "level", fallback=log_level)
|
|
50
|
+
log_time_in_utc = config.getboolean("holado", "log_time_in_utc", fallback=log_time_in_utc)
|
|
51
|
+
log_on_console = config.get("holado", "log_on_console", fallback=log_on_console)
|
|
52
|
+
log_in_file = config.get("holado", "log_in_file", fallback=log_in_file)
|
|
51
53
|
|
|
52
54
|
if log_level:
|
|
53
55
|
if isinstance(log_level, str):
|
|
54
56
|
log_level = logging._nameToLevel[log_level]
|
|
55
57
|
cls.default_level = log_level
|
|
58
|
+
if log_time_in_utc is not None:
|
|
59
|
+
cls.log_time_in_utc = log_time_in_utc
|
|
56
60
|
if log_on_console:
|
|
57
61
|
if isinstance(log_on_console, str):
|
|
58
62
|
log_on_console = True if log_on_console == "True" else False
|
|
@@ -62,6 +66,11 @@ class LogConfig(object):
|
|
|
62
66
|
log_in_file = True if log_in_file == "True" else False
|
|
63
67
|
cls.log_in_file = log_in_file
|
|
64
68
|
|
|
69
|
+
# Change log time format if needed
|
|
70
|
+
if cls.log_time_in_utc:
|
|
71
|
+
import time
|
|
72
|
+
logging.Formatter.converter = time.gmtime
|
|
73
|
+
|
|
65
74
|
cls.__is_configured = True
|
|
66
75
|
|
|
67
76
|
@classmethod
|
holado_python/__init__.py
CHANGED
|
@@ -41,6 +41,7 @@ FORMAT_DATETIME_HUMAN_SECOND = '%Y-%m-%d %H:%M:%S'
|
|
|
41
41
|
|
|
42
42
|
TIMEZONE_LOCAL = datetime.datetime.now().astimezone().tzinfo
|
|
43
43
|
TIMEZONE_UTC = datetime.timezone.utc
|
|
44
|
+
default_timezone = TIMEZONE_UTC
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
class DurationUnit(str, Enum):
|
|
@@ -79,7 +80,7 @@ class DateTime(object):
|
|
|
79
80
|
return cls.__is_system_time_in_tai
|
|
80
81
|
|
|
81
82
|
@classmethod
|
|
82
|
-
def now(cls, tz=
|
|
83
|
+
def now(cls, tz=default_timezone): # @UndefinedVariable
|
|
83
84
|
return datetime.datetime.now(tz=tz)
|
|
84
85
|
|
|
85
86
|
@classmethod
|
holado_report/__init__.py
CHANGED
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
#################################################
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
def configure_module():
|
|
17
|
+
from holado.holado_config import Config
|
|
18
|
+
from holado_python.common.tools.datetime import TIMEZONE_UTC
|
|
19
|
+
|
|
20
|
+
Config.report_timezone = TIMEZONE_UTC
|
|
21
|
+
|
|
16
22
|
def dependencies():
|
|
17
23
|
return ["holado_multitask"]
|
|
18
24
|
|
holado_rest/__init__.py
CHANGED
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
# The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
|
|
13
13
|
#################################################
|
|
14
14
|
|
|
15
|
+
import logging
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def configure_module():
|
|
19
|
+
from holado.holado_config import Config
|
|
20
|
+
|
|
21
|
+
# Default log level
|
|
22
|
+
Config.log_level_rest_request = logging.INFO
|
|
15
23
|
|
|
16
24
|
def dependencies():
|
|
17
25
|
return None
|
|
@@ -20,6 +20,7 @@ from holado_rest.api.rest.rest_manager import RestManager
|
|
|
20
20
|
from holado.common.handlers.undefined import undefined_argument, undefined_value
|
|
21
21
|
import os
|
|
22
22
|
from holado_core.common.tools.converters.converter import Converter
|
|
23
|
+
from holado_core.common.exceptions.technical_exception import TechnicalException
|
|
23
24
|
|
|
24
25
|
logger = logging.getLogger(__name__)
|
|
25
26
|
|
|
@@ -76,7 +77,14 @@ class TestServerClient(RestClient):
|
|
|
76
77
|
netloc_pattern = r"(?P<host>.*?)(?::(?P<port>\d+))?$"
|
|
77
78
|
m = re.match(netloc_pattern, url_parsed.netloc)
|
|
78
79
|
host = m.group('host')
|
|
79
|
-
|
|
80
|
+
if m.group('port') is not None:
|
|
81
|
+
port = Converter.to_integer(m.group('port'))
|
|
82
|
+
elif url_parsed.scheme == "http":
|
|
83
|
+
port = 80
|
|
84
|
+
elif url_parsed.scheme == "https":
|
|
85
|
+
port = 443
|
|
86
|
+
else:
|
|
87
|
+
raise TechnicalException(f"Unable to define port used by test-server (URL: '{self.url}')")
|
|
80
88
|
|
|
81
89
|
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
|
|
82
90
|
sock.settimeout(1)
|
|
@@ -87,7 +95,7 @@ class TestServerClient(RestClient):
|
|
|
87
95
|
return False
|
|
88
96
|
else:
|
|
89
97
|
sock.close()
|
|
90
|
-
logger.debug(f"Ping of test server succeeded")
|
|
98
|
+
logger.debug(f"Ping of test server succeeded for ({host}, {port})")
|
|
91
99
|
return True
|
|
92
100
|
|
|
93
101
|
|
|
File without changes
|
|
File without changes
|