assemblyline-v4-service 4.5.1.dev407__py3-none-any.whl → 4.5.1.dev408__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 assemblyline-v4-service might be problematic. Click here for more details.

@@ -1 +1 @@
1
- 4.5.1.dev407
1
+ 4.5.1.dev408
@@ -19,7 +19,7 @@ from assemblyline.common.uid import get_random_id
19
19
  from assemblyline.odm.messages.task import Task as ServiceTask
20
20
  from assemblyline.odm.models.result import Result
21
21
  from assemblyline.odm.models.service import Service
22
- from assemblyline_v4_service.common.helper import get_heuristics
22
+ from assemblyline_v4_service.common.helper import get_heuristics, get_service_manifest
23
23
 
24
24
 
25
25
  class RunService:
@@ -190,36 +190,29 @@ class RunService:
190
190
  self.identify.stop()
191
191
 
192
192
  def load_service_manifest(self, return_heuristics=False) -> Union[None, Dict]:
193
- service_manifest_yml = os.path.join(os.getcwd(), 'service_manifest.yml')
193
+ service_manifest_data = get_service_manifest()
194
+ heuristics = service_manifest_data.get('heuristics', None)
194
195
 
195
- if os.path.exists(service_manifest_yml):
196
- with open(service_manifest_yml) as yml_fh:
197
- service_manifest_data = yaml.safe_load(yml_fh.read())
196
+ # Pop the 'extra' data from the service manifest
197
+ for x in ['file_required', 'tool_version', 'heuristics']:
198
+ service_manifest_data.pop(x, None)
198
199
 
199
- heuristics = service_manifest_data.get('heuristics', None)
200
-
201
- # Pop the 'extra' data from the service manifest
202
- for x in ['file_required', 'tool_version', 'heuristics']:
203
- service_manifest_data.pop(x, None)
204
-
205
- # Validate the service manifest
206
- try:
207
- self.service = Service(service_manifest_data)
208
- except Exception as e:
209
- LOG.error(f"Invalid service manifest: {str(e)}")
200
+ # Validate the service manifest
201
+ try:
202
+ self.service = Service(service_manifest_data)
203
+ except Exception as e:
204
+ LOG.error(f"Invalid service manifest: {str(e)}")
210
205
 
211
- service_config = {}
212
- if service_manifest_data:
213
- service_config = service_manifest_data.get('config', {})
206
+ service_config = {}
207
+ if service_manifest_data:
208
+ service_config = service_manifest_data.get('config', {})
214
209
 
215
- self.submission_params = {x['name']: x['value']
216
- for x in service_manifest_data.get('submission_params', [])}
210
+ self.submission_params = {x['name']: x['value']
211
+ for x in service_manifest_data.get('submission_params', [])}
217
212
 
218
- self.service = self.service_class(config=service_config)
219
- if return_heuristics:
220
- return heuristics
221
- else:
222
- raise Exception("Service manifest YAML file not found in root folder of service.")
213
+ self.service = self.service_class(config=service_config)
214
+ if return_heuristics:
215
+ return heuristics
223
216
 
224
217
 
225
218
  if __name__ == '__main__':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: assemblyline-v4-service
3
- Version: 4.5.1.dev407
3
+ Version: 4.5.1.dev408
4
4
  Summary: Assemblyline 4 - Service base
5
5
  Home-page: https://github.com/CybercentreCanada/assemblyline-v4-service/
6
6
  Author: CCCS Assemblyline development team
@@ -1,4 +1,4 @@
1
- assemblyline_v4_service/VERSION,sha256=rH6Z41Gv7N6_2A-KjhDIdbLWAitcLtRzwidtwPngDgI,13
1
+ assemblyline_v4_service/VERSION,sha256=LB-fD4DlO44lXp2t8adWksIjWTJ6TDOThRlO2Eeb-h0,13
2
2
  assemblyline_v4_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  assemblyline_v4_service/healthz.py,sha256=sS1cFkDLw8hUPMpj7tbHXFv8ZmHcazrwZ0l6oQDwwkQ,1575
4
4
  assemblyline_v4_service/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -15,7 +15,7 @@ assemblyline_v4_service/common/result.py,sha256=9AqM6qCYiia_Bpyn_fBFhzNQMcqJbtFS
15
15
  assemblyline_v4_service/common/task.py,sha256=dJsvRpW0x88CCF_LW6w87jQ_UKTVaOs2Gb117IDNiU8,14233
16
16
  assemblyline_v4_service/common/utils.py,sha256=k2__d-V5LjB6o2IKbjVe7tJWKcKuUHto5TyT5oKhIa0,3890
17
17
  assemblyline_v4_service/dev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- assemblyline_v4_service/dev/run_service_once.py,sha256=iEWkLnF4cWN0V3Mc6GhMKjDAPYfY0YjESmtReTAJg88,10506
18
+ assemblyline_v4_service/dev/run_service_once.py,sha256=BicBzWVArRzGf8Qxi-_NfP-Cgy9J_1gEQpQb3HBPGTg,10151
19
19
  assemblyline_v4_service/updater/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  assemblyline_v4_service/updater/__main__.py,sha256=9Os-u8Tf7MD73JSrUSPmOaErTgfvesNLiEeszU4ujXA,133
21
21
  assemblyline_v4_service/updater/app.py,sha256=Mtmx4bkXfP4nFqqa5q15jW8QIXr4JK84lCovxAVyvPs,3317
@@ -38,8 +38,8 @@ test/test_common/test_request.py,sha256=Ceyds8BNO1O0f1kH1VEb84faJcaupvSjVKIrGdHe
38
38
  test/test_common/test_result.py,sha256=6BiOKxEPrKBjOY44jv3TY-yiXm0qI1ok_CZBnjP9TM4,45447
39
39
  test/test_common/test_task.py,sha256=P44mNcSe-3tJgDk9ppN3KbM7oN4LBVIuhONG-Gveh74,19007
40
40
  test/test_common/test_utils.py,sha256=TbnBxqpS_ZC5ptXR9XJX3xtbItD0mTbtiBxxdyP8J5k,5904
41
- assemblyline_v4_service-4.5.1.dev407.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
42
- assemblyline_v4_service-4.5.1.dev407.dist-info/METADATA,sha256=x6ov4VqmhS5Y7asvtQcyW4ZGsrdSTriz2Y5JXjZ2mOg,9724
43
- assemblyline_v4_service-4.5.1.dev407.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
44
- assemblyline_v4_service-4.5.1.dev407.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
45
- assemblyline_v4_service-4.5.1.dev407.dist-info/RECORD,,
41
+ assemblyline_v4_service-4.5.1.dev408.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
42
+ assemblyline_v4_service-4.5.1.dev408.dist-info/METADATA,sha256=2LwhYm26sUhEh2fjIP5oocChpDV_GWmZ_r3wg3QHsUo,9724
43
+ assemblyline_v4_service-4.5.1.dev408.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
44
+ assemblyline_v4_service-4.5.1.dev408.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
45
+ assemblyline_v4_service-4.5.1.dev408.dist-info/RECORD,,