check_service_active,
)
from charms.osm_nbi.v0.nbi import NbiProvides
+from charms.osm_temporal.v0.temporal import TemporalRequires
from lightkube.models.core_v1 import ServicePort
from ops.charm import ActionEvent, CharmBase, RelationJoinedEvent
from ops.framework import StoredState
)
self.kafka = KafkaRequires(self)
self.nbi = NbiProvides(self)
+ self.temporal = TemporalRequires(self)
self.mongodb_client = MongoClient(self, "mongodb")
self.prometheus_client = PrometheusClient(self, "prometheus")
self.keystone_client = KeystoneClient(self, "keystone")
# Eventually it will become ready after the first pebble-ready event.
check_container_ready(self.container)
- self._configure_service(self.container)
+ if not self.debug_mode.started:
+ self._configure_service(self.container)
self._update_ingress_config()
self._update_nbi_relation()
# Update charm status
# Action events
self.on.get_debug_mode_information_action: self._on_get_debug_mode_information_action,
self.on.nbi_relation_joined: self._update_nbi_relation,
+ self.on["temporal"].relation_changed: self._on_config_changed,
+ self.on["temporal"].relation_broken: self._on_required_relation_broken,
}
for relation in [self.on[rel_name] for rel_name in ["mongodb", "prometheus", "keystone"]]:
event_handler_mapping[relation.relation_changed] = self._on_config_changed
missing_relations.append("prometheus")
if self.keystone_client.is_missing_data_in_app():
missing_relations.append("keystone")
+ if not self.temporal.host or not self.temporal.port:
+ missing_relations.append("temporal")
if missing_relations:
relations_str = ", ".join(missing_relations)
"OSMNBI_AUTHENTICATION_SERVICE_USERNAME": self.keystone_client.username,
"OSMNBI_AUTHENTICATION_SERVICE_PASSWORD": self.keystone_client.password,
"OSMNBI_AUTHENTICATION_SERVICE_PROJECT": self.keystone_client.service,
+ # DISABLING INTERNAL SSL SERVER
+ "OSMNBI_SERVER_SSL_MODULE": "",
+ "OSMNBI_SERVER_SSL_CERTIFICATE": "",
+ "OSMNBI_SERVER_SSL_PRIVATE_KEY": "",
+ "OSMNBI_SERVER_SSL_PASS_PHRASE": "",
+ # Temporal configuration
+ "OSMNBI_TEMPORAL_HOST": self.temporal.host,
+ "OSMNBI_TEMPORAL_PORT": self.temporal.port,
},
}
},