SEBA-245 Remove Diag Objects
Change-Id: Ifd2d224db94545e13f99b5208d56212b9eda15ae
diff --git a/VERSION b/VERSION
index 7ec1d6d..7c7e096 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.1.0
+2.1.1-dev
diff --git a/xos/core/models/core.xproto b/xos/core/models/core.xproto
index aa84e22..b68d3dc 100644
--- a/xos/core/models/core.xproto
+++ b/xos/core/models/core.xproto
@@ -260,12 +260,6 @@
}
-message Diag (XOSBase) {
- option gui_hidden = True;
- required string name = 1 [max_length = 200, content_type = "stripped", blank = False, help_text = "Name of the synchronizer", null = False, db_index = False, unique = True];
-}
-
-
message Flavor (XOSBase) {
required string name = 1 [max_length = 32, content_type = "stripped", blank = False, help_text = "name of this flavor, as displayed to users", null = False, db_index = False, unique = True];
optional string description = 2 [db_index = False, max_length = 1024, null = True, content_type = "stripped", blank = True];
diff --git a/xos/core/models/diag.py b/xos/core/models/diag.py
deleted file mode 100644
index 1af74ff..0000000
--- a/xos/core/models/diag.py
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from xos.exceptions import *
-from diag_decl import *
-
-class Diag(Diag_decl):
- class Meta:
- proxy = True
diff --git a/xos/coreapi/list_test.py b/xos/coreapi/list_test.py
deleted file mode 100644
index 77fe547..0000000
--- a/xos/coreapi/list_test.py
+++ /dev/null
@@ -1,518 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-import grpc_client
-from grpc_client import Empty
-
-c=grpc_client.InsecureClient("xos-core.cord.lab")
-
-
-print "testing insecure ListServiceControllerResource...",
-c.stub.ListServiceControllerResource(Empty())
-print "Okay"
-print "testing insecure ListXOSVolume...",
-c.stub.ListXOSVolume(Empty())
-print "Okay"
-print "testing insecure ListServiceAttribute...",
-c.stub.ListServiceAttribute(Empty())
-print "Okay"
-print "testing insecure ListControllerImages...",
-c.stub.ListControllerImages(Empty())
-print "Okay"
-print "testing insecure ListControllerSitePrivilege...",
-c.stub.ListControllerSitePrivilege(Empty())
-print "Okay"
-print "testing insecure ListImage...",
-c.stub.ListImage(Empty())
-print "Okay"
-print "testing insecure ListControllerNetwork...",
-c.stub.ListControllerNetwork(Empty())
-print "Okay"
-print "testing insecure ListSite...",
-c.stub.ListSite(Empty())
-print "Okay"
-print "testing insecure ListLibrary...",
-c.stub.ListLibrary(Empty())
-print "Okay"
-print "testing insecure ListSliceRole...",
-c.stub.ListSliceRole(Empty())
-print "Okay"
-print "testing insecure ListSiteDeployment...",
-c.stub.ListSiteDeployment(Empty())
-print "Okay"
-print "testing insecure ListXOSComponentLink...",
-c.stub.ListXOSComponentLink(Empty())
-print "Okay"
-print "testing insecure ListTenantPrivilege...",
-c.stub.ListTenantPrivilege(Empty())
-print "Okay"
-print "testing insecure ListTag...",
-c.stub.ListTag(Empty())
-print "Okay"
-print "testing insecure ListServiceMonitoringAgentInfo...",
-c.stub.ListServiceMonitoringAgentInfo(Empty())
-print "Okay"
-print "testing insecure ListXOSComponent...",
-c.stub.ListXOSComponent(Empty())
-print "Okay"
-print "testing insecure ListInvoice...",
-c.stub.ListInvoice(Empty())
-print "Okay"
-print "testing insecure ListSlicePrivilege...",
-c.stub.ListSlicePrivilege(Empty())
-print "Okay"
-print "testing insecure ListFlavor...",
-c.stub.ListFlavor(Empty())
-print "Okay"
-print "testing insecure ListPort...",
-c.stub.ListPort(Empty())
-print "Okay"
-print "testing insecure ListServiceRole...",
-c.stub.ListServiceRole(Empty())
-print "Okay"
-print "testing insecure ListControllerSite...",
-c.stub.ListControllerSite(Empty())
-print "Okay"
-print "testing insecure ListControllerSlice...",
-c.stub.ListControllerSlice(Empty())
-print "Okay"
-print "testing insecure ListTenantRole...",
-c.stub.ListTenantRole(Empty())
-print "Okay"
-print "testing insecure ListSlice...",
-c.stub.ListSlice(Empty())
-print "Okay"
-print "testing insecure ListLoadableModuleResource...",
-c.stub.ListLoadableModuleResource(Empty())
-print "Okay"
-print "testing insecure ListControllerRole...",
-c.stub.ListControllerRole(Empty())
-print "Okay"
-print "testing insecure ListDiag...",
-c.stub.ListDiag(Empty())
-print "Okay"
-print "testing insecure ListXOS...",
-c.stub.ListXOS(Empty())
-print "Okay"
-print "testing insecure ListServiceClass...",
-c.stub.ListServiceClass(Empty())
-print "Okay"
-print "testing insecure ListTenantAttribute...",
-c.stub.ListTenantAttribute(Empty())
-print "Okay"
-print "testing insecure ListSiteRole...",
-c.stub.ListSiteRole(Empty())
-print "Okay"
-print "testing insecure ListSubscriber...",
-c.stub.ListSubscriber(Empty())
-print "Okay"
-print "testing insecure ListInstance...",
-c.stub.ListInstance(Empty())
-print "Okay"
-print "testing insecure ListCharge...",
-c.stub.ListCharge(Empty())
-print "Okay"
-print "testing insecure ListProgram...",
-c.stub.ListProgram(Empty())
-print "Okay"
-print "testing insecure ListRole...",
-c.stub.ListRole(Empty())
-print "Okay"
-print "testing insecure ListNodeLabel...",
-c.stub.ListNodeLabel(Empty())
-print "Okay"
-print "testing insecure ListNetworkTemplate...",
-c.stub.ListNetworkTemplate(Empty())
-print "Okay"
-print "testing insecure ListServiceController...",
-c.stub.ListServiceController(Empty())
-print "Okay"
-print "testing insecure ListLoadableModule...",
-c.stub.ListLoadableModule(Empty())
-print "Okay"
-print "testing insecure ListUsableObject...",
-c.stub.ListUsableObject(Empty())
-print "Okay"
-print "testing insecure ListNode...",
-c.stub.ListNode(Empty())
-print "Okay"
-print "testing insecure ListAddressPool...",
-c.stub.ListAddressPool(Empty())
-print "Okay"
-print "testing insecure ListDashboardView...",
-c.stub.ListDashboardView(Empty())
-print "Okay"
-print "testing insecure ListNetworkParameter...",
-c.stub.ListNetworkParameter(Empty())
-print "Okay"
-print "testing insecure ListImageDeployments...",
-c.stub.ListImageDeployments(Empty())
-print "Okay"
-print "testing insecure ListControllerUser...",
-c.stub.ListControllerUser(Empty())
-print "Okay"
-print "testing insecure ListReservedResource...",
-c.stub.ListReservedResource(Empty())
-print "Okay"
-print "testing insecure ListJournalEntry...",
-c.stub.ListJournalEntry(Empty())
-print "Okay"
-print "testing insecure ListUserCredential...",
-c.stub.ListUserCredential(Empty())
-print "Okay"
-print "testing insecure ListControllerDashboardView...",
-c.stub.ListControllerDashboardView(Empty())
-print "Okay"
-print "testing insecure ListUserDashboardView...",
-c.stub.ListUserDashboardView(Empty())
-print "Okay"
-print "testing insecure ListController...",
-c.stub.ListController(Empty())
-print "Okay"
-print "testing insecure ListTenantRootRole...",
-c.stub.ListTenantRootRole(Empty())
-print "Okay"
-print "testing insecure ListDeployment...",
-c.stub.ListDeployment(Empty())
-print "Okay"
-print "testing insecure ListReservation...",
-c.stub.ListReservation(Empty())
-print "Okay"
-print "testing insecure ListSitePrivilege...",
-c.stub.ListSitePrivilege(Empty())
-print "Okay"
-print "testing insecure ListPayment...",
-c.stub.ListPayment(Empty())
-print "Okay"
-print "testing insecure ListTenant...",
-c.stub.ListTenant(Empty())
-print "Okay"
-print "testing insecure ListNetwork...",
-c.stub.ListNetwork(Empty())
-print "Okay"
-print "testing insecure ListNetworkSlice...",
-c.stub.ListNetworkSlice(Empty())
-print "Okay"
-print "testing insecure ListAccount...",
-c.stub.ListAccount(Empty())
-print "Okay"
-print "testing insecure ListTenantRoot...",
-c.stub.ListTenantRoot(Empty())
-print "Okay"
-print "testing insecure ListService...",
-c.stub.ListService(Empty())
-print "Okay"
-print "testing insecure ListControllerSlicePrivilege...",
-c.stub.ListControllerSlicePrivilege(Empty())
-print "Okay"
-print "testing insecure ListSiteCredential...",
-c.stub.ListSiteCredential(Empty())
-print "Okay"
-print "testing insecure ListDeploymentPrivilege...",
-c.stub.ListDeploymentPrivilege(Empty())
-print "Okay"
-print "testing insecure ListNetworkParameterType...",
-c.stub.ListNetworkParameterType(Empty())
-print "Okay"
-print "testing insecure ListProvider...",
-c.stub.ListProvider(Empty())
-print "Okay"
-print "testing insecure ListTenantWithContainer...",
-c.stub.ListTenantWithContainer(Empty())
-print "Okay"
-print "testing insecure ListDeploymentRole...",
-c.stub.ListDeploymentRole(Empty())
-print "Okay"
-print "testing insecure ListProject...",
-c.stub.ListProject(Empty())
-print "Okay"
-print "testing insecure ListTenantRootPrivilege...",
-c.stub.ListTenantRootPrivilege(Empty())
-print "Okay"
-print "testing insecure ListXOSComponentVolume...",
-c.stub.ListXOSComponentVolume(Empty())
-print "Okay"
-print "testing insecure ListSliceCredential...",
-c.stub.ListSliceCredential(Empty())
-print "Okay"
-print "testing insecure ListSliceTag...",
-c.stub.ListSliceTag(Empty())
-print "Okay"
-print "testing insecure ListCoarseTenant...",
-c.stub.ListCoarseTenant(Empty())
-print "Okay"
-print "testing insecure ListRouter...",
-c.stub.ListRouter(Empty())
-print "Okay"
-print "testing insecure ListServiceResource...",
-c.stub.ListServiceResource(Empty())
-print "Okay"
-print "testing insecure ListServicePrivilege...",
-c.stub.ListServicePrivilege(Empty())
-print "Okay"
-print "testing insecure ListUser...",
-c.stub.ListUser(Empty())
-print "Okay"
-
-c=grpc_client.SecureClient("xos-core.cord.lab", username="padmin@vicci.org", password="letmein")
-
-
-print "testing secure ListServiceControllerResource...",
-c.stub.ListServiceControllerResource(Empty())
-print "Okay"
-print "testing secure ListXOSVolume...",
-c.stub.ListXOSVolume(Empty())
-print "Okay"
-print "testing secure ListServiceAttribute...",
-c.stub.ListServiceAttribute(Empty())
-print "Okay"
-print "testing secure ListControllerImages...",
-c.stub.ListControllerImages(Empty())
-print "Okay"
-print "testing secure ListControllerSitePrivilege...",
-c.stub.ListControllerSitePrivilege(Empty())
-print "Okay"
-print "testing secure ListImage...",
-c.stub.ListImage(Empty())
-print "Okay"
-print "testing secure ListControllerNetwork...",
-c.stub.ListControllerNetwork(Empty())
-print "Okay"
-print "testing secure ListSite...",
-c.stub.ListSite(Empty())
-print "Okay"
-print "testing secure ListLibrary...",
-c.stub.ListLibrary(Empty())
-print "Okay"
-print "testing secure ListSliceRole...",
-c.stub.ListSliceRole(Empty())
-print "Okay"
-print "testing secure ListSiteDeployment...",
-c.stub.ListSiteDeployment(Empty())
-print "Okay"
-print "testing secure ListXOSComponentLink...",
-c.stub.ListXOSComponentLink(Empty())
-print "Okay"
-print "testing secure ListTenantPrivilege...",
-c.stub.ListTenantPrivilege(Empty())
-print "Okay"
-print "testing secure ListTag...",
-c.stub.ListTag(Empty())
-print "Okay"
-print "testing secure ListServiceMonitoringAgentInfo...",
-c.stub.ListServiceMonitoringAgentInfo(Empty())
-print "Okay"
-print "testing secure ListXOSComponent...",
-c.stub.ListXOSComponent(Empty())
-print "Okay"
-print "testing secure ListInvoice...",
-c.stub.ListInvoice(Empty())
-print "Okay"
-print "testing secure ListSlicePrivilege...",
-c.stub.ListSlicePrivilege(Empty())
-print "Okay"
-print "testing secure ListFlavor...",
-c.stub.ListFlavor(Empty())
-print "Okay"
-print "testing secure ListPort...",
-c.stub.ListPort(Empty())
-print "Okay"
-print "testing secure ListServiceRole...",
-c.stub.ListServiceRole(Empty())
-print "Okay"
-print "testing secure ListControllerSite...",
-c.stub.ListControllerSite(Empty())
-print "Okay"
-print "testing secure ListControllerSlice...",
-c.stub.ListControllerSlice(Empty())
-print "Okay"
-print "testing secure ListTenantRole...",
-c.stub.ListTenantRole(Empty())
-print "Okay"
-print "testing secure ListSlice...",
-c.stub.ListSlice(Empty())
-print "Okay"
-print "testing secure ListLoadableModuleResource...",
-c.stub.ListLoadableModuleResource(Empty())
-print "Okay"
-print "testing secure ListControllerRole...",
-c.stub.ListControllerRole(Empty())
-print "Okay"
-print "testing secure ListDiag...",
-c.stub.ListDiag(Empty())
-print "Okay"
-print "testing secure ListXOS...",
-c.stub.ListXOS(Empty())
-print "Okay"
-print "testing secure ListServiceClass...",
-c.stub.ListServiceClass(Empty())
-print "Okay"
-print "testing secure ListTenantAttribute...",
-c.stub.ListTenantAttribute(Empty())
-print "Okay"
-print "testing secure ListSiteRole...",
-c.stub.ListSiteRole(Empty())
-print "Okay"
-print "testing secure ListSubscriber...",
-c.stub.ListSubscriber(Empty())
-print "Okay"
-print "testing secure ListInstance...",
-c.stub.ListInstance(Empty())
-print "Okay"
-print "testing secure ListCharge...",
-c.stub.ListCharge(Empty())
-print "Okay"
-print "testing secure ListProgram...",
-c.stub.ListProgram(Empty())
-print "Okay"
-print "testing secure ListRole...",
-c.stub.ListRole(Empty())
-print "Okay"
-print "testing secure ListNodeLabel...",
-c.stub.ListNodeLabel(Empty())
-print "Okay"
-print "testing secure ListNetworkTemplate...",
-c.stub.ListNetworkTemplate(Empty())
-print "Okay"
-print "testing secure ListServiceController...",
-c.stub.ListServiceController(Empty())
-print "Okay"
-print "testing secure ListLoadableModule...",
-c.stub.ListLoadableModule(Empty())
-print "Okay"
-print "testing secure ListUsableObject...",
-c.stub.ListUsableObject(Empty())
-print "Okay"
-print "testing secure ListNode...",
-c.stub.ListNode(Empty())
-print "Okay"
-print "testing secure ListAddressPool...",
-c.stub.ListAddressPool(Empty())
-print "Okay"
-print "testing secure ListDashboardView...",
-c.stub.ListDashboardView(Empty())
-print "Okay"
-print "testing secure ListNetworkParameter...",
-c.stub.ListNetworkParameter(Empty())
-print "Okay"
-print "testing secure ListImageDeployments...",
-c.stub.ListImageDeployments(Empty())
-print "Okay"
-print "testing secure ListControllerUser...",
-c.stub.ListControllerUser(Empty())
-print "Okay"
-print "testing secure ListReservedResource...",
-c.stub.ListReservedResource(Empty())
-print "Okay"
-print "testing secure ListJournalEntry...",
-c.stub.ListJournalEntry(Empty())
-print "Okay"
-print "testing secure ListUserCredential...",
-c.stub.ListUserCredential(Empty())
-print "Okay"
-print "testing secure ListControllerDashboardView...",
-c.stub.ListControllerDashboardView(Empty())
-print "Okay"
-print "testing secure ListUserDashboardView...",
-c.stub.ListUserDashboardView(Empty())
-print "Okay"
-print "testing secure ListController...",
-c.stub.ListController(Empty())
-print "Okay"
-print "testing secure ListTenantRootRole...",
-c.stub.ListTenantRootRole(Empty())
-print "Okay"
-print "testing secure ListDeployment...",
-c.stub.ListDeployment(Empty())
-print "Okay"
-print "testing secure ListReservation...",
-c.stub.ListReservation(Empty())
-print "Okay"
-print "testing secure ListSitePrivilege...",
-c.stub.ListSitePrivilege(Empty())
-print "Okay"
-print "testing secure ListPayment...",
-c.stub.ListPayment(Empty())
-print "Okay"
-print "testing secure ListTenant...",
-c.stub.ListTenant(Empty())
-print "Okay"
-print "testing secure ListNetwork...",
-c.stub.ListNetwork(Empty())
-print "Okay"
-print "testing secure ListNetworkSlice...",
-c.stub.ListNetworkSlice(Empty())
-print "Okay"
-print "testing secure ListAccount...",
-c.stub.ListAccount(Empty())
-print "Okay"
-print "testing secure ListTenantRoot...",
-c.stub.ListTenantRoot(Empty())
-print "Okay"
-print "testing secure ListService...",
-c.stub.ListService(Empty())
-print "Okay"
-print "testing secure ListControllerSlicePrivilege...",
-c.stub.ListControllerSlicePrivilege(Empty())
-print "Okay"
-print "testing secure ListSiteCredential...",
-c.stub.ListSiteCredential(Empty())
-print "Okay"
-print "testing secure ListDeploymentPrivilege...",
-c.stub.ListDeploymentPrivilege(Empty())
-print "Okay"
-print "testing secure ListNetworkParameterType...",
-c.stub.ListNetworkParameterType(Empty())
-print "Okay"
-print "testing secure ListProvider...",
-c.stub.ListProvider(Empty())
-print "Okay"
-print "testing secure ListTenantWithContainer...",
-c.stub.ListTenantWithContainer(Empty())
-print "Okay"
-print "testing secure ListDeploymentRole...",
-c.stub.ListDeploymentRole(Empty())
-print "Okay"
-print "testing secure ListProject...",
-c.stub.ListProject(Empty())
-print "Okay"
-print "testing secure ListTenantRootPrivilege...",
-c.stub.ListTenantRootPrivilege(Empty())
-print "Okay"
-print "testing secure ListXOSComponentVolume...",
-c.stub.ListXOSComponentVolume(Empty())
-print "Okay"
-print "testing secure ListSliceCredential...",
-c.stub.ListSliceCredential(Empty())
-print "Okay"
-print "testing secure ListSliceTag...",
-c.stub.ListSliceTag(Empty())
-print "Okay"
-print "testing secure ListCoarseTenant...",
-c.stub.ListCoarseTenant(Empty())
-print "Okay"
-print "testing secure ListRouter...",
-c.stub.ListRouter(Empty())
-print "Okay"
-print "testing secure ListServiceResource...",
-c.stub.ListServiceResource(Empty())
-print "Okay"
-print "testing secure ListServicePrivilege...",
-c.stub.ListServicePrivilege(Empty())
-print "Okay"
-print "testing secure ListUser...",
-c.stub.ListUser(Empty())
-print "Okay"
diff --git a/xos/coreapi/reaper.py b/xos/coreapi/reaper.py
index ebc4556..0dd2d15 100644
--- a/xos/coreapi/reaper.py
+++ b/xos/coreapi/reaper.py
@@ -67,7 +67,6 @@
from django import db
try:
db.connection.cursor()
- #diag = Diag.objects.filter(name="foo").first()
except Exception, e:
if "connection already closed" in traceback.format_exc():
log.exception("XXX connection already closed", e = e)
diff --git a/xos/synchronizers/model_policy.py b/xos/synchronizers/model_policy.py
index 55e8c94..c2eda3a 100644
--- a/xos/synchronizers/model_policy.py
+++ b/xos/synchronizers/model_policy.py
@@ -139,7 +139,6 @@
from django import db
try:
db.connection.cursor()
- #diag = Diag.objects.filter(name="foo").first()
except Exception, e:
if "connection already closed" in traceback.format_exc():
log.error("XXX connection already closed")
diff --git a/xos/synchronizers/new_base/backend.py b/xos/synchronizers/new_base/backend.py
index ee80f2b..dd312fb 100644
--- a/xos/synchronizers/new_base/backend.py
+++ b/xos/synchronizers/new_base/backend.py
@@ -86,8 +86,6 @@
model_policy_thread = None
event_engine = None
- model_accessor.update_diag(sync_start=time.time(), backend_status="Synchronizer Start")
-
steps_dir = Config.get("steps_dir")
if steps_dir:
sync_steps = []
diff --git a/xos/synchronizers/new_base/diag.py b/xos/synchronizers/new_base/diag.py
deleted file mode 100644
index 18b54ad..0000000
--- a/xos/synchronizers/new_base/diag.py
+++ /dev/null
@@ -1,58 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-import traceback
-import json
-
-from xosconfig import Config
-from multistructlog import create_logger
-
-log = create_logger(Config().get('logging'))
-
-
-def update_diag(diag_class, loop_end=None, loop_start=None, syncrecord_start=None, sync_start=None,
- backend_status=None, backend_code=0):
- observer_name = Config.get("name")
-
- try:
- diag = diag_class.objects.filter(name=observer_name).first()
- if (not diag):
- if hasattr(diag_class.objects, "new"):
- # api style
- diag = diag_class.objects.new(name=observer_name)
- else:
- # django style
- diag = diag_class(name=observer_name)
- br_str = diag.backend_register
- if br_str:
- br = json.loads(br_str)
- else:
- br = {}
- if loop_end:
- br['last_run'] = loop_end
- if loop_end and loop_start:
- br['last_duration'] = loop_end - loop_start
- if syncrecord_start:
- br['last_syncrecord_start'] = syncrecord_start
- if sync_start:
- br['last_synchronizer_start'] = sync_start
- if backend_status:
- diag.backend_status = backend_status
- diag.backend_register = json.dumps(br)
- diag.save()
- except:
- log.exception("Exception in update_diag")
- traceback.print_exc()
diff --git a/xos/synchronizers/new_base/djangoaccessor.py b/xos/synchronizers/new_base/djangoaccessor.py
index b76fe9e..98674c4 100644
--- a/xos/synchronizers/new_base/djangoaccessor.py
+++ b/xos/synchronizers/new_base/djangoaccessor.py
@@ -80,7 +80,7 @@
# django implodes if the database connection is closed by
# docker-compose
try:
- diag = self.get_model_class("Diag").objects.filter(name="foo").first()
+ db.connection.cursor()
except Exception as e:
from django import db
if "connection already closed" in traceback.format_exc():
diff --git a/xos/synchronizers/new_base/event_loop.py b/xos/synchronizers/new_base/event_loop.py
index 23fb2ab..5605648 100644
--- a/xos/synchronizers/new_base/event_loop.py
+++ b/xos/synchronizers/new_base/event_loop.py
@@ -226,9 +226,6 @@
log.debug("Synced object", **o.tologdict())
- model_accessor.update_diag(
- syncrecord_start=time.time(), backend_status="Synced Record", backend_code=1)
-
o.enacted = max(o.updated, o.changed_by_policy)
scratchpad = {'next_run': 0, 'exponent': 0,
'last_success': time.time()}
@@ -719,18 +716,8 @@
loop_end = time.time()
- model_accessor.update_diag(
- loop_end=loop_end,
- loop_start=loop_start,
- backend_code=1,
- backend_status="Bottom Of Loop")
-
except Exception as e:
self.log.exception(
'Core error. This seems like a misconfiguration or bug. This error will not be relayed to the user!',
e=e)
self.log.error("Exception in observer run loop")
-
- model_accessor.update_diag(
- backend_code=2,
- backend_status="Exception in Event Loop")
diff --git a/xos/synchronizers/new_base/modelaccessor.py b/xos/synchronizers/new_base/modelaccessor.py
index 27d1f51..7dbd2d6 100644
--- a/xos/synchronizers/new_base/modelaccessor.py
+++ b/xos/synchronizers/new_base/modelaccessor.py
@@ -30,7 +30,6 @@
import signal
import sys
import time
-from diag import update_diag
from loadmodels import ModelLoadClient
from xosconfig import Config
@@ -95,11 +94,6 @@
""" Return the current time for timestamping purposes """
raise Exception("Not Implemented")
- def update_diag(self, loop_end=None, loop_start=None, syncrecord_start=None, sync_start=None, backend_status=None, backend_code=0):
- if self.has_model_class("Diag"):
- return update_diag(self.get_model_class("Diag"), loop_end, loop_start, syncrecord_start, sync_start,
- backend_status,backend_code=0)
-
def is_type(self, obj, name):
""" returns True is obj is of model type "name" """
raise Exception("Not Implemented")
diff --git a/xos/synchronizers/new_base/tests/model-deps b/xos/synchronizers/new_base/tests/model-deps
index 75a60e0..247a190 100644
--- a/xos/synchronizers/new_base/tests/model-deps
+++ b/xos/synchronizers/new_base/tests/model-deps
@@ -214,15 +214,6 @@
],
- "Diag": [
-
-
-
-
-
-
- ],
-
"Flavor": [