CORD-1638 Rename ExampleTenant and drop obsolete references
Change-Id: Ia68efa15d84e536fd2f77aa3fea7ebabfd4a18c2
diff --git a/xos/synchronizer/exampleservice_config.yaml b/xos/synchronizer/exampleservice_config.yaml
index d41f45d..275a09f 100644
--- a/xos/synchronizer/exampleservice_config.yaml
+++ b/xos/synchronizer/exampleservice_config.yaml
@@ -20,7 +20,7 @@
password: "@/opt/xos/services/exampleservice/credentials/xosadmin@opencord.org"
required_models:
- ExampleService
- - ExampleTenant
+ - ExampleServiceInstance
- ServiceDependency
- ServiceMonitoringAgentInfo
dependency_graph: "/opt/xos/synchronizers/exampleservice/model-deps"
diff --git a/xos/synchronizer/model_policies/model_policy_exampletenant.py b/xos/synchronizer/model_policies/model_policy_exampleserviceinstance.py
similarity index 87%
rename from xos/synchronizer/model_policies/model_policy_exampletenant.py
rename to xos/synchronizer/model_policies/model_policy_exampleserviceinstance.py
index ee2880a..8244204 100644
--- a/xos/synchronizer/model_policies/model_policy_exampletenant.py
+++ b/xos/synchronizer/model_policies/model_policy_exampleserviceinstance.py
@@ -17,5 +17,5 @@
from synchronizers.new_base.modelaccessor import *
from synchronizers.new_base.model_policies.model_policy_tenantwithcontainer import TenantWithContainerPolicy
-class ExampleTenantPolicy(TenantWithContainerPolicy):
- model_name = "ExampleTenant"
+class ExampleServiceInstancePolicy(TenantWithContainerPolicy):
+ model_name = "ExampleServiceInstance"
diff --git a/xos/synchronizer/steps/exampletenant_playbook.yaml b/xos/synchronizer/steps/exampleserviceinstance_playbook.yaml
similarity index 95%
rename from xos/synchronizer/steps/exampletenant_playbook.yaml
rename to xos/synchronizer/steps/exampleserviceinstance_playbook.yaml
index 0902bc4..5830815 100644
--- a/xos/synchronizer/steps/exampletenant_playbook.yaml
+++ b/xos/synchronizer/steps/exampleserviceinstance_playbook.yaml
@@ -15,7 +15,7 @@
---
-# exampletenant_playbook
+# exampleserviceinstance_playbook
- hosts: "{{ instance_name }}"
connection: ssh
diff --git a/xos/synchronizer/steps/sync_exampletenant.py b/xos/synchronizer/steps/sync_exampleserviceinstance.py
similarity index 87%
rename from xos/synchronizer/steps/sync_exampletenant.py
rename to xos/synchronizer/steps/sync_exampleserviceinstance.py
index d37e4c3..3462960 100644
--- a/xos/synchronizer/steps/sync_exampletenant.py
+++ b/xos/synchronizer/steps/sync_exampleserviceinstance.py
@@ -25,22 +25,22 @@
logger = Logger(level=logging.INFO)
-class SyncExampleTenant(SyncInstanceUsingAnsible):
+class SyncExampleServiceInstance(SyncInstanceUsingAnsible):
- provides = [ExampleTenant]
+ provides = [ExampleServiceInstance]
- observes = ExampleTenant
+ observes = ExampleServiceInstance
requested_interval = 0
- template_name = "exampletenant_playbook.yaml"
+ template_name = "exampleserviceinstance_playbook.yaml"
service_key_name = "/opt/xos/synchronizers/exampleservice/exampleservice_private_key"
watches = [ModelLink(ServiceDependency,via='servicedependency'), ModelLink(ServiceMonitoringAgentInfo,via='monitoringagentinfo')]
def __init__(self, *args, **kwargs):
- super(SyncExampleTenant, self).__init__(*args, **kwargs)
+ super(SyncExampleServiceInstance, self).__init__(*args, **kwargs)
def get_exampleservice(self, o):
if not o.owner:
@@ -76,7 +76,7 @@
logger.info("handle watch notifications for service monitoring agent info...ignoring because target_uri attribute in monitoring agent info:%s is null" % (monitoring_agent_info))
return
- objs = ExampleTenant.objects.all()
+ objs = ExampleServiceInstance.objects.all()
for obj in objs:
if obj.owner.id != monitoring_agent_info.service.id:
logger.info("handle watch notifications for service monitoring agent info...ignoring because service attribute in monitoring agent info:%s is not matching" % (monitoring_agent_info))
@@ -87,7 +87,7 @@
logger.warn("handle watch notifications for service monitoring agent info...: No valid instance found for object %s" % (str(obj)))
return
- logger.info("handling watch notification for monitoring agent info:%s for ExampleTenant object:%s" % (monitoring_agent_info, obj))
+ logger.info("handling watch notification for monitoring agent info:%s for ExampleServiceInstance object:%s" % (monitoring_agent_info, obj))
#Run ansible playbook to update the routing table entries in the instance
fields = self.get_ansible_fields(instance)
@@ -95,5 +95,5 @@
fields["target_uri"] = monitoring_agent_info.target_uri
template_name = "monitoring_agent.yaml"
- super(SyncExampleTenant, self).run_playbook(obj, fields, template_name)
+ super(SyncExampleServiceInstance, self).run_playbook(obj, fields, template_name)
pass