Reference ops.Object from its definition package

ops's Object is defined in the framework package. The charm package is
only a user.

Change-Id: I3683f30fed9cda28b25efce21c40beaf447e1fca
This commit is contained in:
Guillaume Boutry 2023-12-06 13:45:10 +01:00
parent b2ee00f44c
commit 1cf33168ff
No known key found for this signature in database
GPG Key ID: E95E3326872E55DE
7 changed files with 17 additions and 17 deletions

View File

@ -83,7 +83,7 @@ class GnocchiServiceRequiresHandler(sunbeam_rhandlers.RelationHandler):
"""
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for Gnocchi service relation."""
logger.debug("Setting up Gnocchi service event handler")
svc = GnocchiServiceRequires(

View File

@ -73,7 +73,7 @@ class TraefikRouteHandler(sunbeam_rhandlers.RelationHandler):
"""Run constructor."""
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for an Ingress relation."""
logger.debug("Setting up ingress event handler")
from charms.traefik_route_k8s.v0.traefik_route import (

View File

@ -188,7 +188,7 @@ class DomainConfigHandler(sunbeam_rhandlers.RelationHandler):
):
super().__init__(charm, relation_name, callback_f)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for an Identity service relation."""
logger.debug("Setting up Identity Service event handler")
self.dc = sunbeam_dc_svc.DomainConfigRequires(

View File

@ -34,7 +34,7 @@ an observer for relation changed events.
.. code:: python
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for a MySQL relation."""
logger.debug("Setting up DB event handler")
# Lazy import to ensure this lib is only required if the charm

View File

@ -48,7 +48,7 @@ ContainerDir = collections.namedtuple(
)
class PebbleHandler(ops.charm.Object):
class PebbleHandler(ops.framework.Object):
"""Base handler for Pebble based containers."""
def __init__(

View File

@ -474,7 +474,7 @@ class OVSDBCMSProvidesHandler(
super().__init__(charm, relation_name, callback_f, mandatory)
self._update_address_data()
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for an Identity service relation."""
# Lazy import to ensure this lib is only required if the charm
# has this relation.
@ -525,7 +525,7 @@ class OVSDBCMSRequiresHandler(
"""Run constructor."""
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for an Identity service relation."""
# Lazy import to ensure this lib is only required if the charm
# has this relation.

View File

@ -51,7 +51,7 @@ ERASURE_CODED = "erasure-coded"
REPLICATED = "replicated"
class RelationHandler(ops.charm.Object):
class RelationHandler(ops.framework.Object):
"""Base handler class for relations.
A relation handler is used to manage a charms interaction with a relation
@ -105,7 +105,7 @@ class RelationHandler(ops.charm.Object):
else:
status.set(WaitingStatus("integration incomplete"))
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for the relation.
This method must be overridden in concrete class
@ -113,7 +113,7 @@ class RelationHandler(ops.charm.Object):
"""
raise NotImplementedError
def get_interface(self) -> Tuple[ops.charm.Object, str]:
def get_interface(self) -> Tuple[ops.framework.Object, str]:
"""Return the interface that this handler encapsulates.
This is a combination of the interface object and the
@ -166,7 +166,7 @@ class IngressHandler(RelationHandler):
self.service_name = service_name
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for an Ingress relation."""
logger.debug("Setting up ingress event handler")
from charms.traefik_k8s.v2.ingress import (
@ -269,7 +269,7 @@ class DBHandler(RelationHandler):
self.database_name = database
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for a MySQL relation."""
logger.debug("Setting up DB event handler")
# Import here to avoid import errors if ops_sunbeam is being used
@ -404,7 +404,7 @@ class RabbitMQHandler(RelationHandler):
self.vhost = vhost
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for an AMQP relation."""
logger.debug("Setting up AMQP event handler")
# Lazy import to ensure this lib is only required if the charm
@ -495,7 +495,7 @@ class IdentityServiceRequiresHandler(RelationHandler):
self.region = region
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for an Identity service relation."""
logger.debug("Setting up Identity Service event handler")
import charms.keystone_k8s.v1.identity_service as sun_id
@ -654,7 +654,7 @@ class CephClientHandler(RelationHandler):
self.app_name = app_name
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for an ceph-client interface."""
logger.debug("Setting up ceph-client event handler")
# Lazy import to ensure this lib is only required if the charm
@ -1099,7 +1099,7 @@ class IdentityCredentialsRequiresHandler(RelationHandler):
"""
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for identity-credentials relation."""
import charms.keystone_k8s.v0.identity_credentials as identity_credentials
@ -1306,7 +1306,7 @@ class CephAccessRequiresHandler(RelationHandler):
"""
super().__init__(charm, relation_name, callback_f, mandatory)
def setup_event_handler(self) -> ops.charm.Object:
def setup_event_handler(self) -> ops.framework.Object:
"""Configure event handlers for ceph-access relation."""
import charms.cinder_ceph_k8s.v0.ceph_access as ceph_access