41
41
42
42
# Increment this PATCH version before using `charmcraft publish-lib` or reset
43
43
# to 0 if you are raising the major API version
44
- LIBPATCH = 4
44
+ LIBPATCH = 5
45
45
46
46
logger = logging .getLogger (__name__ )
47
47
61
61
BACKUP_RESTORE_MAX_ATTEMPTS = 10
62
62
BACKUP_RESTORE_ATTEMPT_COOLDOWN = 15
63
63
64
+ INVALID_INTEGRATION_STATUS = BlockedStatus (
65
+ "Relation to s3-integrator is not supported, config role must be config-server"
66
+ )
67
+
64
68
65
69
_StrOrBytes = Union [str , bytes ]
66
70
@@ -136,11 +140,7 @@ def on_s3_relation_joined(self, event: RelationJoinedEvent) -> None:
136
140
logger .debug (
137
141
"Shard does not support s3 relations, please relate s3-integrator to config-server only."
138
142
)
139
- self .charm .status .set_and_share_status (
140
- BlockedStatus (
141
- "Relation to s3-integrator is not supported, config role must be config-server"
142
- )
143
- )
143
+ self .charm .status .set_and_share_status (INVALID_INTEGRATION_STATUS )
144
144
145
145
def _on_s3_credential_changed (self , event : CredentialsChangedEvent ):
146
146
"""Sets pbm credentials, resyncs if necessary and reports config errors."""
@@ -154,7 +154,11 @@ def _on_s3_credential_changed(self, event: CredentialsChangedEvent):
154
154
event .defer ()
155
155
return
156
156
157
- if not self ._pass_sanity_checks (event , action ):
157
+ if not self .is_valid_s3_integration ():
158
+ logger .debug (
159
+ "Shard does not support s3 relations, please relate s3-integrator to config-server only."
160
+ )
161
+ self .charm .status .set_and_share_status (INVALID_INTEGRATION_STATUS )
158
162
return
159
163
160
164
if not self .charm .db_initialised :
0 commit comments