[SEBA-450] (part 2)
Add tox testing support on additional XOS library modules:
- xos-api
- xos-kafka (has no tests)
- xos-migrate (has no tests)
- xos-synchronizer
Change-Id: I98195bc9747971d3515882d517affe058dd86ac5
diff --git a/lib/xos-api/xosapi/xos_grpc_client.py b/lib/xos-api/xosapi/xos_grpc_client.py
index a80843f..fba9ce4 100644
--- a/lib/xos-api/xosapi/xos_grpc_client.py
+++ b/lib/xos-api/xosapi/xos_grpc_client.py
@@ -12,35 +12,33 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from __future__ import print_function
+from __future__ import absolute_import, print_function
+
import argparse
import base64
import functools
-import grpc
-import orm
+import inspect
import os
import sys
-from twisted.internet import reactor
from google.protobuf.empty_pb2 import Empty
-from grpc import (
- metadata_call_credentials,
- composite_channel_credentials,
- ssl_channel_credentials,
-)
-# fix up sys.path for chameleon
-import inspect
+import grpc
+from grpc import (composite_channel_credentials, metadata_call_credentials,
+ ssl_channel_credentials)
-currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
-sys.path = [currentdir] + sys.path
-
+from twisted.internet import reactor
from xosconfig import Config
-import chameleon_client.grpc_client as chameleon_client
+
+from xosapi import orm
+import xosapi.chameleon_client.grpc_client as chameleon_client
from multistructlog import create_logger
log = create_logger(Config().get("logging"))
+currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
+sys.path = [currentdir] + sys.path
+
SERVER_CA = "/usr/local/share/ca-certificates/local_certs.crt"
@@ -97,7 +95,7 @@
for cm in response.convenience_methods:
log.debug("Saving convenience method", method=cm.filename)
save_path = os.path.join(convenience_methods_dir, cm.filename)
- file(save_path, "w").write(cm.contents)
+ open(save_path, "w").write(cm.contents)
else:
log.exception(
"Cannot load convenience methods, restarting the synchronzier"