* add __init__.py in cmd folder * add coriolis-dbsync command * move resources under coriolis folder * modify setup.py to build the write_data binary on Linux * add MANIFEST.in to include the binary
@@ -0,0 +1 @@
+include coriolis/resources/write_data
@@ -288,12 +288,9 @@ def get_ssl_cert_thumbprint(context, host, port=443, digest_algorithm="sha1"):
return x509.digest('sha1').decode()
-def _get_base_dir():
- return os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-
def get_resources_dir():
- return os.path.join(_get_base_dir(), "resources")
+ return os.path.join(
+ os.path.dirname(os.path.abspath(__file__)), "resources")
def serialize_key(key, password=None):
@@ -28,6 +28,7 @@ console_scripts =
coriolis-api = coriolis.cmd.api:main
coriolis-conductor = coriolis.cmd.conductor:main
coriolis-worker = coriolis.cmd.worker:main
+ coriolis-dbsync = coriolis.cmd.db_sync:main
[wheel]
universal = 1
@@ -1,6 +1,20 @@
import setuptools
+import subprocess
+import platform
+import os
+def _compile_and_install():
+ if platform.system() != "Linux":
+ return
+ dirname = os.path.dirname(__file__)
+ resources = os.path.join(dirname, "coriolis", "resources")
+ if os.path.isdir(resources):
+ subprocess.check_call(
+ ["make"], cwd=resources, shell=True)
+
+_compile_and_install()
setuptools.setup(
setup_requires=['pbr>=1.8'],
pbr=True)