fix 1150 limit error length of a failing SDN connector
It is not updating database entry vim_wim_actions when error lenght is longer than 1024
Change-Id: I2cb529e7a82784bd7a2274e617ad58ab275feefc
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
diff --git a/RO-plugin/osm_ro_plugin/sdn_failing.py b/RO-plugin/osm_ro_plugin/sdn_failing.py
index b8ea42f..fac28aa 100644
--- a/RO-plugin/osm_ro_plugin/sdn_failing.py
+++ b/RO-plugin/osm_ro_plugin/sdn_failing.py
@@ -36,7 +36,6 @@
we need a replacement for it, that will throw an error every time we try to
execute any action
"""
-import json
from osm_ro_plugin.sdnconn import SdnConnectorError
@@ -61,28 +60,23 @@
raise SdnConnectorError('Impossible to use WIM:\n' + self.error_msg)
def get_connectivity_service_status(self, service_uuid, _conn_info=None):
- raise SdnConnectorError('Impossible to retrieve status for {}\n\n{}'
+ raise SdnConnectorError('Impossible to retrieve status for {}: {}'
.format(service_uuid, self.error_msg))
def create_connectivity_service(self, service_uuid, *args, **kwargs):
- raise SdnConnectorError('Impossible to connect {}.\n{}\n{}\n{}'
- .format(service_uuid, self.error_msg,
- json.dumps(args, indent=4),
- json.dumps(kwargs, indent=4)))
+ raise SdnConnectorError('Impossible to create connectivity: {}'
+ .format(self.error_msg))
def delete_connectivity_service(self, service_uuid, _conn_info=None):
- raise SdnConnectorError('Impossible to disconnect {}\n\n{}'
+ raise SdnConnectorError('Impossible to delete {}: {}'
.format(service_uuid, self.error_msg))
def edit_connectivity_service(self, service_uuid, *args, **kwargs):
- raise SdnConnectorError('Impossible to change connection {}.\n{}\n'
- '{}\n{}'
- .format(service_uuid, self.error_msg,
- json.dumps(args, indent=4),
- json.dumps(kwargs, indent=4)))
+ raise SdnConnectorError('Impossible to change connection {}: {}'
+ .format(service_uuid, self.error_msg))
def clear_all_connectivity_services(self):
- raise SdnConnectorError('Impossible to use WIM:\n' + self.error_msg)
+ raise SdnConnectorError('Impossible to use WIM: {}'.format(self.error_msg))
def get_all_active_connectivity_services(self):
- raise SdnConnectorError('Impossible to use WIM:\n' + self.error_msg)
+ raise SdnConnectorError('Impossible to use WIM: {}'.format(self.error_msg))