Skip to content

Commit 342be5e

Browse files
committed
fix version issue for automatic connector install
This is a patch from Kestrel side. A upstream patch on stix-shifter will be better preventing the issue: opencybersecurityalliance/stix-shifter#1087
1 parent 1bbfa7a commit 342be5e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/kestrel_datasource_stixshifter/connector.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import importlib
44
import subprocess
55
import requests
6+
import pkg_resources
67
from lxml import html
78

89
from kestrel.exceptions import DataSourceError
@@ -69,10 +70,14 @@ def check_module_availability(connector_name):
6970

7071
verify_package_origin(connector_name)
7172

72-
_logger.info(f'install Python package "{package_name}".')
73+
stixshifter_version = pkg_resources.get_distribution("stix_shifter").version
74+
75+
package_w_ver = package_name + "==" + stixshifter_version
76+
77+
_logger.info(f'install Python package "{package_w_ver}".')
7378
try:
7479
subprocess.check_call(
75-
[sys.executable, "-m", "pip", "install", package_name]
80+
[sys.executable, "-m", "pip", "install", package_w_ver]
7681
)
7782
except:
7883
_logger.info("package installation with 'pip' failed.")

0 commit comments

Comments
 (0)