holado 0.8.3__py3-none-any.whl → 0.9.0__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-0.8.3.dist-info → holado-0.9.0.dist-info}/METADATA +1 -1
- {holado-0.8.3.dist-info → holado-0.9.0.dist-info}/RECORD +31 -16
- holado_core/common/resource/persisted_data_manager.py +10 -10
- holado_core/common/resource/resource_manager.py +34 -37
- holado_core/common/resource/table_data_manager.py +110 -0
- holado_core/common/tools/path_manager.py +30 -5
- holado_docker/tools/docker_controller/client/rest/docker_controller_client.py +2 -2
- holado_docker/tools/docker_controller/server/rest/api/os.py +6 -0
- holado_docker/tools/docker_controller/server/rest/openapi.yaml +4 -1
- holado_python/common/tools/datetime.py +7 -4
- holado_python/standard_library/ssl/resources/certificates/tcpbin.crt +16 -16
- holado_python/standard_library/ssl/resources/certificates/tcpbin.key +26 -26
- holado_report/__init__.py +1 -0
- holado_report/campaign/campaign_manager.py +189 -0
- holado_report/report/report_manager.py +2 -0
- holado_system/system/filesystem/file.py +5 -2
- holado_test/test_server/server/Dockerfile +70 -0
- holado_test/test_server/server/core/server_context.py +42 -0
- holado_test/test_server/server/core/server_manager.py +54 -0
- holado_test/test_server/server/requirements.txt +2 -0
- holado_test/test_server/server/rest/README +2 -0
- holado_test/test_server/server/rest/api/__init__.py +23 -0
- holado_test/test_server/server/rest/api/campaign/__init__.py +28 -0
- holado_test/test_server/server/rest/api/campaign/scenario.py +33 -0
- holado_test/test_server/server/rest/initialize_holado.py +72 -0
- holado_test/test_server/server/rest/logging.conf +50 -0
- holado_test/test_server/server/rest/openapi.yaml +46 -0
- holado_test/test_server/server/rest/run.py +40 -0
- holado_test/test_server/server/run_test_server_in_docker.sh +101 -0
- {holado-0.8.3.dist-info → holado-0.9.0.dist-info}/WHEEL +0 -0
- {holado-0.8.3.dist-info → holado-0.9.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -97,9 +97,10 @@ holado_core/common/inspectors/tree_inspector.py,sha256=DYXmzGFQAzAT1pypKqxpOGPze
|
|
|
97
97
|
holado_core/common/inspectors/tools/inspect_builder.py,sha256=v7azgwciXHtO-o7gcgI5gOo3B-7rfRs8RQNO_q5LWjI,6830
|
|
98
98
|
holado_core/common/inspectors/tools/inspect_context.py,sha256=lzhhO5HxG00c6uMPyIXEUz0FHA61VCNUZr_39ykZ8lQ,2700
|
|
99
99
|
holado_core/common/inspectors/tools/inspect_parameters.py,sha256=2vXUpnZlP2cCYTvI9ddI6NGhONideoM1hBJ0vGdvPKo,7346
|
|
100
|
-
holado_core/common/resource/persisted_data_manager.py,sha256=
|
|
100
|
+
holado_core/common/resource/persisted_data_manager.py,sha256=3pI2qPu0O_SQY4AdfeuAWV8LtzXWkb7q7RiAMVpKvGs,6325
|
|
101
101
|
holado_core/common/resource/persisted_method_to_call_manager.py,sha256=8iHJF3oPB5PLLLmXK9ncFc7oSyEWyRUWnwJPEzWj3zw,13813
|
|
102
|
-
holado_core/common/resource/resource_manager.py,sha256=
|
|
102
|
+
holado_core/common/resource/resource_manager.py,sha256=VP86iQ7_NZzQQ0uUpeev1PjgiejUuwKbV5RfGCNC5tI,7179
|
|
103
|
+
holado_core/common/resource/table_data_manager.py,sha256=bigQGMwh1m3P6ZEO3wi2ftmvyEwpZhGbNCVtI794ops,6289
|
|
103
104
|
holado_core/common/tables/__init__.py,sha256=i2-gExPOUa_AnmEPgZJQ2lAXeK02PLpPnjEqbsgj1Co,8
|
|
104
105
|
holado_core/common/tables/enums.py,sha256=YtYTSI1m6KQ3XFzOSFPi5De6Jc-nkDMTbnmqfRfsiJ0,1395
|
|
105
106
|
holado_core/common/tables/table.py,sha256=VV-68K0J7lzgWpmzesYdU3-ZrkmaIfu9eIYlNhAA02c,10252
|
|
@@ -125,7 +126,7 @@ holado_core/common/tables/comparators/table_with_header_comparator.py,sha256=j7B
|
|
|
125
126
|
holado_core/common/tables/converters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
126
127
|
holado_core/common/tables/converters/table_converter.py,sha256=PD7NJoxtejpr4aS1l3YKcXW1aEn1xBxdi4Ljs5G7R4g,10251
|
|
127
128
|
holado_core/common/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
128
|
-
holado_core/common/tools/path_manager.py,sha256=
|
|
129
|
+
holado_core/common/tools/path_manager.py,sha256=wACYsmQ5Pq8iB6KXGkDwhA8-HwL1FJAM1EyH1ww7Ijc,10743
|
|
129
130
|
holado_core/common/tools/string_tools.py,sha256=bQuMlI_yS7OoSPFL7qyfyXkrnjC8xHVpIsfmEC6JxhI,5590
|
|
130
131
|
holado_core/common/tools/tools.py,sha256=zkDz7u8S_02bfyN6K-p7-Ey_SkDxzu9DJljnczY0OAo,9683
|
|
131
132
|
holado_core/common/tools/comparators/comparator.py,sha256=K4LcXIRORHX5vkmDibI6P6Bu1L-6Xezb63ZzzOMKrWY,6812
|
|
@@ -194,7 +195,7 @@ holado_docker/sdk/docker/docker_service.py,sha256=SvMSIZ7XTCbC7q5rur03lJhJVSHL3u
|
|
|
194
195
|
holado_docker/tests/behave/steps/__init__.py,sha256=lrP0btKLA3qQD2wp3zbOp0ug8RmgpaYWCrOAWehcPiI,1298
|
|
195
196
|
holado_docker/tests/behave/steps/tools/docker_controller/client_steps.py,sha256=Y26ZstOZrI3uVX6MGBQr88jjDEsCsNuik0ZBmpT5kDg,4800
|
|
196
197
|
holado_docker/tools/docker_controller/docker_controller_manager.py,sha256=q3oac2KIK9wGfMQqGIol65nHUmeuuV0rQ61tfH2APAk,2477
|
|
197
|
-
holado_docker/tools/docker_controller/client/rest/docker_controller_client.py,sha256=
|
|
198
|
+
holado_docker/tools/docker_controller/client/rest/docker_controller_client.py,sha256=1NiBNGRXozOK-92cyGdvW00Q8KuJNjfjMxgsuL4tqjw,4560
|
|
198
199
|
holado_docker/tools/docker_controller/server/Dockerfile,sha256=zuSkj3HYDhvpjOSXmxL4oDqhN7dRB1YTX5Fyur1cuDY,1774
|
|
199
200
|
holado_docker/tools/docker_controller/server/requirements.txt,sha256=0RvLV3t2DyBR2FsbAd1WVEcbsVc6FVUN2horQJU4POo,57
|
|
200
201
|
holado_docker/tools/docker_controller/server/run_docker_controller_in_docker.sh,sha256=Q56P8VA895I29kVSaSa2FpzvjxJUwLVZ9-7vjScXfc0,3406
|
|
@@ -204,12 +205,12 @@ holado_docker/tools/docker_controller/server/grpc/proto/compile_proto.py,sha256=
|
|
|
204
205
|
holado_docker/tools/docker_controller/server/grpc/proto/definitions/docker_controler.proto,sha256=n9bsXaQfnZX-R5HvfquCVt3QjpFtDJSH6p8gnTjm06k,1650
|
|
205
206
|
holado_docker/tools/docker_controller/server/rest/README,sha256=-uqu3drdPXkPkU4ha1IKcXGBHFIBEWH-uiTT74DExwE,167
|
|
206
207
|
holado_docker/tools/docker_controller/server/rest/initialize_holado.py,sha256=UxNphXyjs-xraorzMWjDe6-QYw_Q3mtykyY-ENYZB1o,3464
|
|
207
|
-
holado_docker/tools/docker_controller/server/rest/openapi.yaml,sha256=
|
|
208
|
+
holado_docker/tools/docker_controller/server/rest/openapi.yaml,sha256=8mhJdAYi-wftxdStsD6el0j1Zo8zqx1MzwqZndyKhMY,6864
|
|
208
209
|
holado_docker/tools/docker_controller/server/rest/run.py,sha256=8w5Xl7uOnjsYW59cmuUMOUd71fcXQn30k2jVis7cVNs,1748
|
|
209
210
|
holado_docker/tools/docker_controller/server/rest/api/__init__.py,sha256=FlLRagAiw1LDxnF0CmW7Y6bVXuj8x6volT8-DuHTTVY,2427
|
|
210
211
|
holado_docker/tools/docker_controller/server/rest/api/config.py,sha256=Ln__1bsigSzJZ-Iy3MQgmiZMnpBxC3TCQE0O72g5cAs,2459
|
|
211
212
|
holado_docker/tools/docker_controller/server/rest/api/container.py,sha256=6D612WF4chpDCzr4MBzZXzELxi-yOwrgxCxSBBVMcVo,2673
|
|
212
|
-
holado_docker/tools/docker_controller/server/rest/api/os.py,sha256=
|
|
213
|
+
holado_docker/tools/docker_controller/server/rest/api/os.py,sha256=EA3DCxGBCnMd2XJyn9kb6IWmtbaPIyv5UfZypCNzkhY,2123
|
|
213
214
|
holado_docker/tools/docker_viewer/docker_viewer_manager.py,sha256=tSLuIUdYjJoZIFUc1k4WnrRTUtjjTAmNTbrDmS-8SjI,2287
|
|
214
215
|
holado_docker/tools/docker_viewer/client/rest/docker_viewer_client.py,sha256=XNBt7QE-Elz9wUT32hdft7vU0ytcY8f-0AvlDZ8NWMo,2005
|
|
215
216
|
holado_docker/tools/docker_viewer/server/Dockerfile,sha256=012m7y_jg1Jh0NoqJSUTnmG9OppX2zlcFe-KhB71cVA,1750
|
|
@@ -340,7 +341,7 @@ holado_protobuf/tests/behave/steps/ipc/protobuf_steps.py,sha256=Pbw5E-AbTTSKR_i_
|
|
|
340
341
|
holado_python/__init__.py,sha256=uZzFUgE2zqLWiM-2yF9D5KinWqZYqoXYMCiD02A3iW8,1657
|
|
341
342
|
holado_python/common/enums.py,sha256=iwffWOqUdiFaOn83RPmjRVVHakTjQve55sNsbY4x8Ek,1535
|
|
342
343
|
holado_python/common/iterables.py,sha256=p5X6h18W-GSnZ4WHt5Y5g3Ri4TB4B5i5NhyAwb7g1Ww,2064
|
|
343
|
-
holado_python/common/tools/datetime.py,sha256=
|
|
344
|
+
holado_python/common/tools/datetime.py,sha256=MZMUHaSjJ6r_ulvWiISBBmF9j4tdErSslQNb1iYCHno,12280
|
|
344
345
|
holado_python/common/tools/comparators/boolean_comparator.py,sha256=66AtqQ1u7NLTKAmgZHdnbE8vMPfgwJ2ZrzMiea90jX0,2042
|
|
345
346
|
holado_python/common/tools/comparators/bytes_comparator.py,sha256=VKD5Q734n1k5Q0zX14fYgvM-66ysyRWkjo2fLgleyt0,2412
|
|
346
347
|
holado_python/common/tools/comparators/datetime_comparator.py,sha256=6smSvQ7ErnNuBNHkSbkf4HoSUJU54DNS2ILhxM1FHAk,3487
|
|
@@ -363,8 +364,8 @@ holado_python/standard_library/ssl/resources/certificates/NOTES.txt,sha256=GlPGG
|
|
|
363
364
|
holado_python/standard_library/ssl/resources/certificates/localhost.crt,sha256=iLmZpDuOQVawUlbZkb72g2-uv1c4SAmRJOrm4Th5anY,1123
|
|
364
365
|
holado_python/standard_library/ssl/resources/certificates/localhost.key,sha256=lP2NCvB9mr2E5sk8whA8FyQRcyU6H7sdWkJeKz80Hyc,1704
|
|
365
366
|
holado_python/standard_library/ssl/resources/certificates/rootCACert.pem,sha256=ECQDZ8OHRfqpZHCu6JRLMUjiONaPIhKZQF0-kidVrWQ,1424
|
|
366
|
-
holado_python/standard_library/ssl/resources/certificates/tcpbin.crt,sha256=
|
|
367
|
-
holado_python/standard_library/ssl/resources/certificates/tcpbin.key,sha256=
|
|
367
|
+
holado_python/standard_library/ssl/resources/certificates/tcpbin.crt,sha256=woxSPsEfsOV22o8f8czARubRoj61KaM1PFsw0ii6fVo,1237
|
|
368
|
+
holado_python/standard_library/ssl/resources/certificates/tcpbin.key,sha256=MX0JkPAK-UVpUnCxWfWhDGA_XeKLRrK4DOuVGxLpmeI,1704
|
|
368
369
|
holado_python/tests/behave/steps/__init__.py,sha256=TWEk-kBTTDHi9I4nuu48nufmNMdZ9FHAhPZv0A_cWzc,1661
|
|
369
370
|
holado_python/tests/behave/steps/convert_steps.py,sha256=bZqRvJVp_u6fSPpdu4ne9NwVyZmui7R-AVdO2-H-I1A,2728
|
|
370
371
|
holado_python/tests/behave/steps/iterable_steps.py,sha256=f4vGIWBH8Qnjq69Q-ZBluYyctQ8SKauazTc41dsktZA,4041
|
|
@@ -391,9 +392,10 @@ holado_redis/tests/behave/steps/tools/redis_client_steps.py,sha256=lOh0YlumJcszt
|
|
|
391
392
|
holado_redis/tools/redis/TODO.txt,sha256=cmFyx6qS6_FgL1Ph0OWRsWch6MQaklfv1j0qBO2ZpZU,202
|
|
392
393
|
holado_redis/tools/redis/redis_client.py,sha256=KWuOrnwTcwt5xkD3rtI_l07v164Y_bsoo1kE0IGzqaQ,8316
|
|
393
394
|
holado_redis/tools/redis/redis_manager.py,sha256=tMO0XrCZTCfGdByFfgWXk9R-I_TUPLO9wXMQf8yCYcQ,1814
|
|
394
|
-
holado_report/__init__.py,sha256=
|
|
395
|
+
holado_report/__init__.py,sha256=vjp7Ce8hO334H5V1Qk4uhDkvVspXD3iiS5oTrQSM_vs,1687
|
|
396
|
+
holado_report/campaign/campaign_manager.py,sha256=olXOGtAdQ-tyxHve2SI_dXiu2F7ItDzLWS-j8T9zY54,8523
|
|
395
397
|
holado_report/report/execution_historic.py,sha256=hXosOGtsq-O9Oq6AeBXWlnIQxSy3bv89QKYPCHF9_GY,6799
|
|
396
|
-
holado_report/report/report_manager.py,sha256=
|
|
398
|
+
holado_report/report/report_manager.py,sha256=nwzgbDdxehGcl4-V8asjYReKiuPGsBdSDEO8inBT6h4,12400
|
|
397
399
|
holado_report/report/analyze/execution_historic_manager.py,sha256=FMKKPguXOvWNxjF7Q8DodHHsH-2ci9pFzrTV41B8nL4,4556
|
|
398
400
|
holado_report/report/analyze/scenario_duration_manager.py,sha256=Preaxu83qFKGfbvQnzolhSXztZ4i5Zo_Bnxx8tNA80Q,12468
|
|
399
401
|
holado_report/report/builders/detailed_scenario_failed_report_builder.py,sha256=LuuanB2BGnsY1EiCfmYIw-8CZY3nMsr0m2Oec4wyxkA,7501
|
|
@@ -480,7 +482,7 @@ holado_system/system/command/command.py,sha256=9lv9kgvvIq4Fqx6fJXU_HQA8pCO80Ws9r
|
|
|
480
482
|
holado_system/system/command/command_result.py,sha256=sunGDegNVOtpK9s9r4HCAJlREu4iKS0w3HY4KKDEQkw,4613
|
|
481
483
|
holado_system/system/command/curl_command.py,sha256=CEMaO0_qLyKe4tLytMlHzmCuS_gi-oU479hwOaEyZ60,3743
|
|
482
484
|
holado_system/system/command/exceptions.py,sha256=InT6t8GVeGCiBE-NpRr4NzycWVAvzmc6WpM6mk7_1yk,2363
|
|
483
|
-
holado_system/system/filesystem/file.py,sha256=
|
|
485
|
+
holado_system/system/filesystem/file.py,sha256=LAu5h-tbDSCsdNF0YFR9MACJAanBzbevqeH6awtOR5Y,4196
|
|
484
486
|
holado_system/tests/behave/steps/__init__.py,sha256=7LrCSTHk5oHNuEsr4IhJuNDsohtR2cq3YT1owXrhdjc,1351
|
|
485
487
|
holado_system/tests/behave/steps/system/commands_steps.py,sha256=uYiojPpYPkfif8l8afRrJ0sj-wFBE4j1x67BDMNs76Q,3901
|
|
486
488
|
holado_system/tests/behave/steps/system/file_steps.py,sha256=-RPUGEjsYfzWIMRDiQRalmvspPZIPP8YMzSZvSI4-p8,9966
|
|
@@ -501,6 +503,19 @@ holado_test/common/context/step_context.py,sha256=j6S4ozTPrdlpV9Slopc998fYOV8KfM
|
|
|
501
503
|
holado_test/common/exceptions/undefined_step_exception.py,sha256=SHHX22iz4Ip-V4Y3aM2EJFDt30CCS5EaauN6KB-JORo,1461
|
|
502
504
|
holado_test/scenario/step_tools.py,sha256=iNay6tQPUi4sG-a8PY5LbbLpX0PRakkOj3ls98aEbHM,26375
|
|
503
505
|
holado_test/scenario/tester_tools.py,sha256=Tv035FyXPjQ46Ep8KuPOjOvzJFvxnbv9EsrSihUzAwg,2479
|
|
506
|
+
holado_test/test_server/server/Dockerfile,sha256=TR_xUU2YLmKYWeGUaRRZRhaBHKHa4Y_1nqQDquK843w,1744
|
|
507
|
+
holado_test/test_server/server/requirements.txt,sha256=c2iNG9IZZogAEC9oSWRTWEF9-OHW0vRtijPNK4P6_xY,45
|
|
508
|
+
holado_test/test_server/server/run_test_server_in_docker.sh,sha256=HdDCcP1Q5fUk3_xQbxkZ-FIyoZgrYErrgS6EHLpY8x0,3095
|
|
509
|
+
holado_test/test_server/server/core/server_context.py,sha256=aDl5rOJpxG9MT_jpymL0ST9z7FpoNOBAk5dLGAPGXas,1223
|
|
510
|
+
holado_test/test_server/server/core/server_manager.py,sha256=PW5ShUdnbdq6E3Ou87C5feXuJRc1V7qADkmGItLIi3A,2890
|
|
511
|
+
holado_test/test_server/server/rest/README,sha256=J_LIXWFxtxc8okQGZ8Kk0dMSRra9oUzbMP_ylCe4pTo,161
|
|
512
|
+
holado_test/test_server/server/rest/initialize_holado.py,sha256=UxNphXyjs-xraorzMWjDe6-QYw_Q3mtykyY-ENYZB1o,3464
|
|
513
|
+
holado_test/test_server/server/rest/logging.conf,sha256=yeNIHFQCYlDmkdLlQ3NCoMuxpUNn6i8ZDAzOUna_2aA,1282
|
|
514
|
+
holado_test/test_server/server/rest/openapi.yaml,sha256=4Juf_QggWo7z9te3_sS96TxxARWU1MtFkJZAilEsxr8,1027
|
|
515
|
+
holado_test/test_server/server/rest/run.py,sha256=0BC3fHDDaE28IoObQrICUatDRAOiFxrb0WU_VZU2q4Y,2321
|
|
516
|
+
holado_test/test_server/server/rest/api/__init__.py,sha256=4QcsiWhFX0sGhJYuoqUUfwEYb6ceIDlFFlU1q3ls7Xc,1442
|
|
517
|
+
holado_test/test_server/server/rest/api/campaign/__init__.py,sha256=btZb20N5k7_WbowNAC1C7yYDUkwPnUU5QUmh-jO0bhg,1586
|
|
518
|
+
holado_test/test_server/server/rest/api/campaign/scenario.py,sha256=4eTIScEGL0GKD7g6aIPHJVvaVbwz487zlEg9mRQv84Y,1737
|
|
504
519
|
holado_test/tests/behave/steps/__init__.py,sha256=rdqrp-UN7vRplIqORx4sXyKwMUkptRizyLWudsmYehM,1362
|
|
505
520
|
holado_test/tests/behave/steps/scenario/exception_steps.py,sha256=ZIE92Dz7a6O_c0jAP_0dj6Hc0tnW6YRgNKd4_aBpeR0,4054
|
|
506
521
|
holado_test/tests/behave/steps/scenario/scenario_steps.py,sha256=RfM5Lh4sduKeYSD1NzUxtQ8705O7nausoz_gnpAJQB0,4616
|
|
@@ -655,7 +670,7 @@ test_holado/tools/django/api_rest/api_rest/api1/serializers.py,sha256=o_YxFr-tgC
|
|
|
655
670
|
test_holado/tools/django/api_rest/api_rest/api1/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
|
|
656
671
|
test_holado/tools/django/api_rest/api_rest/api1/views.py,sha256=kOt2xT6bxO47_z__5yYR9kcYIWWv4qYzpX0K8Tqonik,758
|
|
657
672
|
test_holado/tools/django/api_rest/api_rest/api1/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
658
|
-
holado-0.
|
|
659
|
-
holado-0.
|
|
660
|
-
holado-0.
|
|
661
|
-
holado-0.
|
|
673
|
+
holado-0.9.0.dist-info/METADATA,sha256=yjrLJcSpelFEAZHNTocVq8XdVBn57k1OoLHAy68evvI,7671
|
|
674
|
+
holado-0.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
675
|
+
holado-0.9.0.dist-info/licenses/LICENSE,sha256=IgGmNlcFHnbp7UWrLJqAFvs_HIgjJDTmjCNRircJLsk,1070
|
|
676
|
+
holado-0.9.0.dist-info/RECORD,,
|
|
@@ -42,26 +42,26 @@ class PersistedDataManager():
|
|
|
42
42
|
return self.__table_name
|
|
43
43
|
|
|
44
44
|
def ensure_persistent_db_exists(self):
|
|
45
|
-
if self.__resource_manager.has_data_table(self.__table_name, db_name=self.__db_name):
|
|
46
|
-
if self.__resource_manager.check_data_table_schema(self.__table_name, self.__table_sql_create, db_name=self.__db_name):
|
|
45
|
+
if self.__resource_manager.has_data_table(self.__table_name, db_name=self.__db_name, is_persistent=True):
|
|
46
|
+
if self.__resource_manager.check_data_table_schema(self.__table_name, self.__table_sql_create, db_name=self.__db_name, is_persistent=True):
|
|
47
47
|
# Table already exists with the right schema
|
|
48
48
|
return
|
|
49
49
|
else:
|
|
50
50
|
# Table already exists but with wrong schema => delete table before creating it again
|
|
51
|
-
self.__resource_manager.delete_data_table(self.__table_name, db_name=self.__db_name, raise_if_not_exist=True, do_commit=True)
|
|
51
|
+
self.__resource_manager.delete_data_table(self.__table_name, db_name=self.__db_name, is_persistent=True, raise_if_not_exist=True, do_commit=True)
|
|
52
52
|
|
|
53
53
|
# Create table
|
|
54
54
|
# Note: method create_data_table raise an exception if it doesn't succeed to create the table
|
|
55
|
-
self.__resource_manager.create_data_table(self.__table_name, self.__table_sql_create, db_name=self.__db_name, raise_if_exist=True, do_commit=True, do_audit=self.__do_audit)
|
|
55
|
+
self.__resource_manager.create_data_table(self.__table_name, self.__table_sql_create, db_name=self.__db_name, is_persistent=True, raise_if_exist=True, do_commit=True, do_audit=self.__do_audit)
|
|
56
56
|
|
|
57
57
|
def has_persisted_data(self, filter_data=None, filter_compare_data=None):
|
|
58
|
-
return self.__resource_manager.
|
|
58
|
+
return self.__resource_manager.has_data(self.__table_name, where_data=filter_data, where_compare_data=filter_compare_data, db_name=self.__db_name, is_persistent=True)
|
|
59
59
|
|
|
60
60
|
def get_persisted_datas(self, filter_data=None, filter_compare_data=None, as_generator=False):
|
|
61
61
|
"""
|
|
62
62
|
Note: Whereas 'data' is already a plural, a 's' is added in method name to be coherent with other method names
|
|
63
63
|
"""
|
|
64
|
-
return self.__resource_manager.
|
|
64
|
+
return self.__resource_manager.get_data(self.__table_name, where_data=filter_data, where_compare_data=filter_compare_data, db_name=self.__db_name, is_persistent=True, result_as_dict_list=True, as_generator=as_generator)
|
|
65
65
|
|
|
66
66
|
def get_persisted_data(self, filter_data=None, filter_compare_data=None):
|
|
67
67
|
"""
|
|
@@ -76,12 +76,12 @@ class PersistedDataManager():
|
|
|
76
76
|
return None
|
|
77
77
|
|
|
78
78
|
def count_persisted_data(self, filter_data=None, filter_compare_data=None):
|
|
79
|
-
return self.__resource_manager.
|
|
79
|
+
return self.__resource_manager.count_data(self.__table_name, where_data=filter_data, where_compare_data=filter_compare_data, db_name=self.__db_name, is_persistent=True)
|
|
80
80
|
|
|
81
81
|
def update_persisted_data(self, data, filter_data=None, filter_compare_data=None):
|
|
82
82
|
if Tools.do_log(logger, logging.DEBUG):
|
|
83
83
|
logger.debug(f"Update persisted {self.__data_name} for {filter_data} and {filter_compare_data}: {data}")
|
|
84
|
-
self.__resource_manager.
|
|
84
|
+
self.__resource_manager.update_data(self.__table_name, data, where_data=filter_data, where_compare_data=filter_compare_data, db_name=self.__db_name, is_persistent=True)
|
|
85
85
|
|
|
86
86
|
def add_persisted_data(self, data, persisted_filter_data=None):
|
|
87
87
|
if Tools.do_log(logger, logging.DEBUG):
|
|
@@ -89,7 +89,7 @@ class PersistedDataManager():
|
|
|
89
89
|
data = copy.copy(data)
|
|
90
90
|
if persisted_filter_data:
|
|
91
91
|
data.update(persisted_filter_data)
|
|
92
|
-
self.__resource_manager.
|
|
92
|
+
self.__resource_manager.add_data(self.__table_name, data, db_name=self.__db_name, is_persistent=True)
|
|
93
93
|
|
|
94
94
|
def update_or_add_persisted_data(self, persisted_filter_data, data, persisted_data=undefined_argument):
|
|
95
95
|
if persisted_data is undefined_argument:
|
|
@@ -103,7 +103,7 @@ class PersistedDataManager():
|
|
|
103
103
|
self.add_persisted_data(data, persisted_filter_data)
|
|
104
104
|
|
|
105
105
|
def delete_persisted_data(self, filter_data):
|
|
106
|
-
self.__resource_manager.
|
|
106
|
+
self.__resource_manager.delete_data(self.__table_name, where_data=filter_data, db_name=self.__db_name, is_persistent=True)
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
|
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
import os
|
|
15
15
|
import logging
|
|
16
|
-
from holado.common.context.session_context import SessionContext
|
|
17
|
-
from holado_core.common.exceptions.technical_exception import TechnicalException
|
|
18
|
-
from holado_core.common.exceptions.functional_exception import FunctionalException
|
|
19
|
-
from holado_core.common.tools.tools import Tools
|
|
20
|
-
# from holado_report.report.analyze.scenario_duration_manager import ScenarioDurationManager
|
|
21
16
|
|
|
22
17
|
logger = logging.getLogger(__name__)
|
|
23
18
|
|
|
@@ -56,44 +51,45 @@ class ResourceManager():
|
|
|
56
51
|
def get_path(self, *args):
|
|
57
52
|
return os.path.join(self.__local_resource_path, *args)
|
|
58
53
|
|
|
59
|
-
def
|
|
54
|
+
def get_db_client(self, name, is_persistent=False):
|
|
55
|
+
""" Return a SQLite3 DB client to the resource DB of given name
|
|
56
|
+
@param is_persistent If True, name is prefixed with 'persistent/db/'
|
|
60
57
|
"""
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_, res = self.__db_manager.get_or_create(name, 'sqlite3', self.__get_db_connect_kwargs(name))
|
|
58
|
+
full_name = os.path.join("persistent", "db", name) if is_persistent else name
|
|
59
|
+
_, res = self.__db_manager.get_or_create(full_name, 'sqlite3', self.__get_db_connect_kwargs(full_name))
|
|
64
60
|
return res
|
|
65
61
|
|
|
66
|
-
def __get_db_connect_kwargs(self,
|
|
67
|
-
if
|
|
68
|
-
db_filepath = self.get_path(
|
|
69
|
-
|
|
62
|
+
def __get_db_connect_kwargs(self, full_name):
|
|
63
|
+
if full_name not in self.__db_connect_kwargs_by_name:
|
|
64
|
+
db_filepath = self.get_path(f"{full_name}.sqlite3")
|
|
65
|
+
self.__path_manager.makedirs(db_filepath)
|
|
70
66
|
|
|
71
67
|
uri = f"file:{db_filepath}?mode=rwc"
|
|
72
68
|
connect_kwargs = {'database': uri,
|
|
73
69
|
'uri': True}
|
|
74
|
-
self.__db_connect_kwargs_by_name[
|
|
75
|
-
return self.__db_connect_kwargs_by_name[
|
|
70
|
+
self.__db_connect_kwargs_by_name[full_name] = connect_kwargs
|
|
71
|
+
return self.__db_connect_kwargs_by_name[full_name]
|
|
76
72
|
|
|
77
73
|
def persist_pair(self, key, value, db_name="default", table_name="pair", do_commit=True):
|
|
78
|
-
client = self.
|
|
74
|
+
client = self.get_db_client(db_name, is_persistent=True)
|
|
79
75
|
client.execute(f"create table if not exists {table_name} (key, value)", do_commit=do_commit)
|
|
80
76
|
|
|
81
77
|
client.execute(f"insert into {table_name} values (?, ?)", key, value, do_commit=do_commit)
|
|
82
78
|
|
|
83
|
-
def has_data_table(self, table_name, db_name="default"):
|
|
84
|
-
client = self.
|
|
79
|
+
def has_data_table(self, table_name, db_name="default", is_persistent=False):
|
|
80
|
+
client = self.get_db_client(db_name, is_persistent=is_persistent)
|
|
85
81
|
return client.exist_table(table_name)
|
|
86
82
|
|
|
87
|
-
def create_data_table(self, table_name, create_sql, db_name="default", raise_if_exist=False, do_commit=True, do_audit=False):
|
|
88
|
-
client = self.
|
|
83
|
+
def create_data_table(self, table_name, create_sql, db_name="default", is_persistent=False, raise_if_exist=False, do_commit=True, do_audit=False):
|
|
84
|
+
client = self.get_db_client(db_name, is_persistent=is_persistent)
|
|
89
85
|
client.create_table(table_name, create_sql, raise_if_exist=raise_if_exist, do_commit=do_commit, do_audit=do_audit)
|
|
90
86
|
|
|
91
|
-
def delete_data_table(self, table_name, db_name="default", raise_if_not_exist=False, do_commit=True):
|
|
92
|
-
client = self.
|
|
87
|
+
def delete_data_table(self, table_name, db_name="default", is_persistent=False, raise_if_not_exist=False, do_commit=True):
|
|
88
|
+
client = self.get_db_client(db_name, is_persistent=is_persistent)
|
|
93
89
|
client.drop_table(table_name, raise_if_not_exist=raise_if_not_exist, do_commit=do_commit)
|
|
94
90
|
|
|
95
|
-
def check_data_table_schema(self, table_name, create_sql, db_name="default"):
|
|
96
|
-
client = self.
|
|
91
|
+
def check_data_table_schema(self, table_name, create_sql, db_name="default", is_persistent=False):
|
|
92
|
+
client = self.get_db_client(db_name, is_persistent=is_persistent)
|
|
97
93
|
result = client.select("sqlite_schema", where_data={'name':table_name}, sql_return='sql')
|
|
98
94
|
if not result:
|
|
99
95
|
return False
|
|
@@ -101,29 +97,30 @@ class ResourceManager():
|
|
|
101
97
|
sql = result[0][0].content
|
|
102
98
|
return sql == create_sql
|
|
103
99
|
|
|
104
|
-
def
|
|
105
|
-
client = self.
|
|
100
|
+
def count_data(self, table_name, where_data: dict=None, where_compare_data: list=None, db_name="default", is_persistent=False):
|
|
101
|
+
client = self.get_db_client(db_name, is_persistent=is_persistent)
|
|
106
102
|
return client.count(table_name, where_data=where_data, where_compare_data=where_compare_data)
|
|
107
103
|
|
|
108
|
-
def
|
|
109
|
-
count = self.
|
|
104
|
+
def has_data(self, table_name, where_data: dict=None, where_compare_data: list=None, db_name="default", is_persistent=False):
|
|
105
|
+
count = self.count_data(table_name, where_data=where_data, where_compare_data=where_compare_data, db_name=db_name, is_persistent=is_persistent)
|
|
110
106
|
return count > 0
|
|
111
107
|
|
|
112
|
-
def
|
|
113
|
-
client = self.
|
|
108
|
+
def get_data(self, table_name, where_data: dict=None, where_compare_data: list=None, db_name="default", is_persistent=False, result_as_dict_list=False, as_generator=False):
|
|
109
|
+
client = self.get_db_client(db_name, is_persistent=is_persistent)
|
|
114
110
|
result = client.select(table_name, where_data=where_data, where_compare_data=where_compare_data, result_as_dict_list=result_as_dict_list, as_generator=as_generator)
|
|
115
111
|
return result
|
|
116
112
|
|
|
117
|
-
def
|
|
118
|
-
client = self.
|
|
119
|
-
client.insert(table_name, data, do_commit=do_commit)
|
|
113
|
+
def add_data(self, table_name, data: dict, db_name="default", is_persistent=False, do_commit=True):
|
|
114
|
+
client = self.get_db_client(db_name, is_persistent=is_persistent)
|
|
115
|
+
result = client.insert(table_name, data, do_commit=do_commit)
|
|
116
|
+
return result
|
|
120
117
|
|
|
121
|
-
def
|
|
122
|
-
client = self.
|
|
118
|
+
def update_data(self, table_name, data: dict, where_data: dict=None, where_compare_data: list=None, db_name="default", is_persistent=False, do_commit=True):
|
|
119
|
+
client = self.get_db_client(db_name, is_persistent=is_persistent)
|
|
123
120
|
result = client.update(table_name, data=data, where_data=where_data, where_compare_data=where_compare_data, do_commit=do_commit)
|
|
124
121
|
return result
|
|
125
122
|
|
|
126
|
-
def
|
|
127
|
-
client = self.
|
|
123
|
+
def delete_data(self, table_name, where_data: dict=None, where_compare_data: list=None, db_name="default", is_persistent=False, do_commit=True):
|
|
124
|
+
client = self.get_db_client(db_name, is_persistent=is_persistent)
|
|
128
125
|
client.delete(table_name, where_data=where_data, where_compare_data=where_compare_data, do_commit=do_commit)
|
|
129
126
|
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
|
|
2
|
+
#################################################
|
|
3
|
+
# HolAdo (Holistic Automation do)
|
|
4
|
+
#
|
|
5
|
+
# (C) Copyright 2021-2025 by Eric Klumpp
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
8
|
+
#
|
|
9
|
+
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
10
|
+
|
|
11
|
+
# 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.
|
|
12
|
+
#################################################
|
|
13
|
+
|
|
14
|
+
import logging
|
|
15
|
+
from holado_core.common.exceptions.technical_exception import TechnicalException
|
|
16
|
+
from holado_core.common.tools.tools import Tools
|
|
17
|
+
import copy
|
|
18
|
+
from holado.common.handlers.undefined import undefined_argument
|
|
19
|
+
|
|
20
|
+
logger = logging.getLogger(__name__)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TableDataManager():
|
|
25
|
+
"""
|
|
26
|
+
Manage data stored in a dedicated resource table.
|
|
27
|
+
"""
|
|
28
|
+
def __init__(self, data_name, table_name, table_sql_create, db_name="default", is_persistent=False, do_audit=False):
|
|
29
|
+
self.__data_name = data_name
|
|
30
|
+
self.__table_name = table_name
|
|
31
|
+
self.__table_sql_create = table_sql_create
|
|
32
|
+
self.__db_name = db_name
|
|
33
|
+
self.__is_persistent = is_persistent
|
|
34
|
+
self.__do_audit = do_audit
|
|
35
|
+
|
|
36
|
+
self.__resource_manager = None
|
|
37
|
+
|
|
38
|
+
def initialize(self, resource_manager):
|
|
39
|
+
self.__resource_manager = resource_manager
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def table_name(self):
|
|
43
|
+
return self.__table_name
|
|
44
|
+
|
|
45
|
+
def ensure_db_exists(self):
|
|
46
|
+
if self.__resource_manager.has_data_table(self.__table_name, db_name=self.__db_name, is_persistent=self.__is_persistent):
|
|
47
|
+
if self.__resource_manager.check_data_table_schema(self.__table_name, self.__table_sql_create, db_name=self.__db_name, is_persistent=self.__is_persistent):
|
|
48
|
+
# Table already exists with the right schema
|
|
49
|
+
return
|
|
50
|
+
else:
|
|
51
|
+
# Table already exists but with wrong schema => delete table before creating it again
|
|
52
|
+
self.__resource_manager.delete_data_table(self.__table_name, db_name=self.__db_name, is_persistent=self.__is_persistent, raise_if_not_exist=True, do_commit=True)
|
|
53
|
+
|
|
54
|
+
# Create table
|
|
55
|
+
# Note: method create_data_table raise an exception if it doesn't succeed to create the table
|
|
56
|
+
self.__resource_manager.create_data_table(self.__table_name, self.__table_sql_create, db_name=self.__db_name, is_persistent=self.__is_persistent, raise_if_exist=True, do_commit=True, do_audit=self.__do_audit)
|
|
57
|
+
|
|
58
|
+
def has_data(self, filter_data=None, filter_compare_data=None):
|
|
59
|
+
return self.__resource_manager.has_data(self.__table_name, where_data=filter_data, where_compare_data=filter_compare_data, db_name=self.__db_name, is_persistent=self.__is_persistent)
|
|
60
|
+
|
|
61
|
+
def get_datas(self, filter_data=None, filter_compare_data=None, as_generator=False):
|
|
62
|
+
"""
|
|
63
|
+
Note: Whereas 'data' is already a plural, a 's' is added in method name to be coherent with other method names
|
|
64
|
+
"""
|
|
65
|
+
return self.__resource_manager.get_data(self.__table_name, where_data=filter_data, where_compare_data=filter_compare_data, db_name=self.__db_name, is_persistent=self.__is_persistent, result_as_dict_list=True, as_generator=as_generator)
|
|
66
|
+
|
|
67
|
+
def get_data(self, filter_data=None, filter_compare_data=None):
|
|
68
|
+
"""
|
|
69
|
+
Note: Whereas 'datum' should be the right word in method name since method returns only one datum, method is named with 'data' in its usual singular meaning for most people.
|
|
70
|
+
"""
|
|
71
|
+
data = self.get_datas(filter_data=filter_data, filter_compare_data=filter_compare_data)
|
|
72
|
+
if len(data) > 1:
|
|
73
|
+
raise TechnicalException(f"Too many ({len(data)}) {self.__data_name} found for filter {filter_data}.")
|
|
74
|
+
elif len(data) == 1:
|
|
75
|
+
return data[0]
|
|
76
|
+
else:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
def count_data(self, filter_data=None, filter_compare_data=None):
|
|
80
|
+
return self.__resource_manager.count_data(self.__table_name, where_data=filter_data, where_compare_data=filter_compare_data, db_name=self.__db_name, is_persistent=self.__is_persistent)
|
|
81
|
+
|
|
82
|
+
def update_data(self, data, filter_data=None, filter_compare_data=None):
|
|
83
|
+
if Tools.do_log(logger, logging.DEBUG):
|
|
84
|
+
logger.debug(f"Update {self.__data_name} for {filter_data} and {filter_compare_data}: {data}")
|
|
85
|
+
self.__resource_manager.update_data(self.__table_name, data, where_data=filter_data, where_compare_data=filter_compare_data, db_name=self.__db_name, is_persistent=self.__is_persistent)
|
|
86
|
+
|
|
87
|
+
def add_data(self, data, filter_data=None):
|
|
88
|
+
if Tools.do_log(logger, logging.DEBUG):
|
|
89
|
+
logger.debug(f"Add {self.__data_name} for {filter_data}: {data}")
|
|
90
|
+
data = copy.copy(data)
|
|
91
|
+
if filter_data:
|
|
92
|
+
data.update(filter_data)
|
|
93
|
+
self.__resource_manager.add_data(self.__table_name, data, db_name=self.__db_name, is_persistent=self.__is_persistent)
|
|
94
|
+
|
|
95
|
+
def update_or_add_data(self, filter_data, data, existing_data=undefined_argument):
|
|
96
|
+
if existing_data is undefined_argument:
|
|
97
|
+
has_data = self.has_data(filter_data)
|
|
98
|
+
else:
|
|
99
|
+
has_data = existing_data is not None
|
|
100
|
+
|
|
101
|
+
if has_data:
|
|
102
|
+
self.update_data(data, filter_data=filter_data)
|
|
103
|
+
else:
|
|
104
|
+
self.add_data(data, filter_data)
|
|
105
|
+
|
|
106
|
+
def delete_data(self, filter_data):
|
|
107
|
+
self.__resource_manager.delete_data(self.__table_name, where_data=filter_data, db_name=self.__db_name, is_persistent=self.__is_persistent)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
@@ -21,6 +21,7 @@ from holado_core.common.exceptions.functional_exception import FunctionalExcepti
|
|
|
21
21
|
from datetime import datetime
|
|
22
22
|
from holado_core.common.tools.tools import Tools
|
|
23
23
|
from pathlib import Path
|
|
24
|
+
from holado_python.common.tools.datetime import DateTime
|
|
24
25
|
|
|
25
26
|
logger = logging.getLogger(__name__)
|
|
26
27
|
|
|
@@ -192,15 +193,39 @@ class PathManager(object):
|
|
|
192
193
|
now_str = datetime.strftime(dt, dt_format)
|
|
193
194
|
return f"{prefix}_{now_str}.{ext}"
|
|
194
195
|
|
|
195
|
-
def
|
|
196
|
+
def find_files(self, dir_path, prefix=None, subdir_relative_path=None, since_datetime=None):
|
|
196
197
|
res = []
|
|
197
198
|
for filename in os.listdir(dir_path):
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
file_path = os.path.join(dir_path, filename)
|
|
200
|
+
|
|
201
|
+
if subdir_relative_path is not None:
|
|
202
|
+
# Filter directories that doesn't contain expected sub-file
|
|
203
|
+
if not os.path.isdir(file_path):
|
|
204
|
+
continue
|
|
205
|
+
file_path = os.path.join(file_path, subdir_relative_path)
|
|
206
|
+
if not os.path.exists(file_path):
|
|
207
|
+
continue
|
|
208
|
+
else:
|
|
209
|
+
# Filter paths that are not files
|
|
210
|
+
if not os.path.isfile(file_path):
|
|
211
|
+
continue
|
|
212
|
+
|
|
213
|
+
# Filter on prefix
|
|
214
|
+
if prefix is not None and not filename.startswith(prefix):
|
|
215
|
+
continue
|
|
216
|
+
|
|
217
|
+
# Filter on file modification datetime
|
|
218
|
+
if since_datetime is not None:
|
|
219
|
+
dt_last_modif = DateTime.timestamp_to_datetime(os.path.getmtime(file_path))
|
|
220
|
+
if dt_last_modif < since_datetime:
|
|
221
|
+
continue
|
|
222
|
+
|
|
223
|
+
# File is matching criteria
|
|
224
|
+
res.append(file_path)
|
|
200
225
|
return res
|
|
201
226
|
|
|
202
|
-
def
|
|
203
|
-
files = self.
|
|
227
|
+
def find_file(self, dir_path, prefix=None, since_datetime=None):
|
|
228
|
+
files = self.find_files(dir_path, prefix=prefix, since_datetime=since_datetime)
|
|
204
229
|
|
|
205
230
|
if len(files) == 0:
|
|
206
231
|
raise FunctionalException(f"Unable to find a file starting with '{prefix}' in folder '{dir_path}'")
|
|
@@ -30,8 +30,8 @@ class DockerControllerClient(RestClient):
|
|
|
30
30
|
response = self.get(f"os/env", json=data)
|
|
31
31
|
return self.response_result(response, status_ok=[200])
|
|
32
32
|
|
|
33
|
-
def get_directory_filenames(self, path):
|
|
34
|
-
data = {'path':path}
|
|
33
|
+
def get_directory_filenames(self, path, extension='.yml'):
|
|
34
|
+
data = {'path':path, 'extension':extension}
|
|
35
35
|
response = self.get(f"os/ls", json=data)
|
|
36
36
|
return self.response_result(response, status_ok=[200])
|
|
37
37
|
|
|
@@ -29,9 +29,15 @@ class LsView(MethodView):
|
|
|
29
29
|
|
|
30
30
|
def get(self, body: dict):
|
|
31
31
|
dir_path = body['path']
|
|
32
|
+
extension = body.get('extension', None)
|
|
33
|
+
|
|
34
|
+
if not os.path.exists(dir_path) or not os.path.isdir(dir_path):
|
|
35
|
+
return f"Directory '{dir_path}' doesn't exist", 406
|
|
32
36
|
|
|
33
37
|
res = []
|
|
34
38
|
for filename in os.listdir(dir_path):
|
|
39
|
+
if extension is not None and not filename.endswith(extension):
|
|
40
|
+
continue
|
|
35
41
|
if os.path.isfile(os.path.join(dir_path, filename)):
|
|
36
42
|
res.append(filename)
|
|
37
43
|
|
|
@@ -40,11 +40,14 @@ paths:
|
|
|
40
40
|
properties:
|
|
41
41
|
path:
|
|
42
42
|
type: string
|
|
43
|
+
extension:
|
|
44
|
+
type: string
|
|
45
|
+
nullable: true
|
|
43
46
|
responses:
|
|
44
47
|
200:
|
|
45
48
|
description: "Directory filenames"
|
|
46
49
|
content:
|
|
47
|
-
application/
|
|
50
|
+
application/json:
|
|
48
51
|
schema:
|
|
49
52
|
type: "array"
|
|
50
53
|
items:
|
|
@@ -22,7 +22,7 @@ import os
|
|
|
22
22
|
from holado_core.common.tools.converters.converter import Converter
|
|
23
23
|
from enum import Enum
|
|
24
24
|
from holado_python.common.enums import ArithmeticOperator
|
|
25
|
-
from datetime import timedelta
|
|
25
|
+
from datetime import timedelta, timezone
|
|
26
26
|
from dateutil.relativedelta import relativedelta
|
|
27
27
|
import math
|
|
28
28
|
from decimal import Decimal
|
|
@@ -126,15 +126,18 @@ class DateTime(object):
|
|
|
126
126
|
return res
|
|
127
127
|
|
|
128
128
|
@classmethod
|
|
129
|
-
def str_2_datetime(cls, dt_str, dt_format=None):
|
|
129
|
+
def str_2_datetime(cls, dt_str, dt_format=None, default_timezone=timezone.utc):
|
|
130
130
|
"""Convert string to datetime instance"""
|
|
131
131
|
res = None
|
|
132
132
|
if dt_format is None:
|
|
133
133
|
res = dateutil.parser.parse(dt_str)
|
|
134
134
|
else:
|
|
135
135
|
res = datetime.datetime.strptime(dt_str, dt_format)
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
|
|
137
|
+
# Set timezone if needed
|
|
138
|
+
if res.tzinfo is None and default_timezone is not None:
|
|
139
|
+
res = res.replace(tzinfo=default_timezone)
|
|
140
|
+
|
|
138
141
|
return res
|
|
139
142
|
|
|
140
143
|
@classmethod
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
MIIDZTCCAk2gAwIBAgIBKjANBgkqhkiG9w0BAQsFADCBizELMAkGA1UEBhMCVVMx
|
|
3
3
|
CzAJBgNVBAgMAkNBMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ8wDQYDVQQKDAZ0
|
|
4
4
|
Y3BiaW4xDDAKBgNVBAsMA29wczETMBEGA1UEAwwKdGNwYmluLmNvbTEjMCEGCSqG
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
FOLuMowBSAZfV5v82LmlaIIOvU/
|
|
15
|
-
/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
SIb3DQEJARYUaGFycnliYWdkaUBnbWFpbC5jb20wHhcNMjUwOTI0MTAzMzE5WhcN
|
|
6
|
+
MjUwOTI1MTAzMzE5WjAcMRowGAYDVQQDDBF0Y3BiaW4uY29tLWNsaWVudDCCASIw
|
|
7
|
+
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALuFFkk1M7uFHl+/XHsVOYe3BAjO
|
|
8
|
+
FIXrlDFk0D3G9QAwjpuDnCPYSrhAHpSxdVrp+5RV9L/OFj7ome2O9thFKvQJaG89
|
|
9
|
+
g44Jpa1SnVysonZui23GJZUcbS2td8tLXVyE6e+v8CeIjeQvjKqkS/t4t+4SkBCU
|
|
10
|
+
4PUt6aP+PuK1aG0/7KqBoctC12c0RwRqh+eJAHBxlb69/OzdOTTpXpXMyzWuyLTp
|
|
11
|
+
gzHbBhbtMHle/0dk/gHmh+/dAASCnoHfIOHOvqRW57p/SpnKW80QkshxArS6/mvm
|
|
12
|
+
7RkxYpQEjrAWpk24CcR+LYbL5Q89oXvxmXg4V2IiEvy4oXRh9vXG/obe06UCAwEA
|
|
13
|
+
AaNCMEAwHQYDVR0OBBYEFD7PxtLlvXy3LXcd2TsiB6KewQxeMB8GA1UdIwQYMBaA
|
|
14
|
+
FOLuMowBSAZfV5v82LmlaIIOvU/DMA0GCSqGSIb3DQEBCwUAA4IBAQAwUvYMFteT
|
|
15
|
+
N/CVVickwg/MpAv2/HLr5NeajfKQO9ya7K9ymHF8WU2S9MSwXUuJ4/wGzNwbpXmj
|
|
16
|
+
hsbh0W06ZL1ClrWr/US6lkHZegbVBGkF3qwDP0kMYVXEp6LcEy0e6lX4ey9t342H
|
|
17
|
+
RBxbxmzXsp1plV4PecWXGt7LF18kzMe57sbGmSgDZ0LDGANFM97C72ytNrR2v5XB
|
|
18
|
+
Mw1t5C5I9IowMWh484Ue/VUtGCekCvtrfO0ur1tta7y0mRIJu49MmPJeAdScefSj
|
|
19
|
+
ke+Pf96v53zieSpMoV8mvI8f6Mjt3GMVq07VX7+IWufxJ7FXx7TQ1q3LBdOVtsZ7
|
|
20
|
+
+biJwocFLiem
|
|
21
21
|
-----END CERTIFICATE-----
|