File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 32
32
from charms .rolling_ops .v0 .rollingops import RollingOpsManager , RunWithLock
33
33
from charms .tempo_k8s .v1 .charm_tracing import trace_charm
34
34
from charms .tempo_k8s .v2 .tracing import TracingEndpointRequirer
35
- from ops import JujuVersion
35
+ from ops import JujuVersion , main
36
36
from ops .charm import (
37
37
ActionEvent ,
38
38
HookEvent ,
42
42
StartEvent ,
43
43
)
44
44
from ops .framework import EventBase
45
- from ops .main import main
46
45
from ops .model import (
47
46
ActiveStatus ,
48
47
BlockedStatus ,
@@ -883,8 +882,14 @@ def _on_install(self, event: InstallEvent) -> None:
883
882
884
883
cache = snap .SnapCache ()
885
884
postgres_snap = cache [POSTGRESQL_SNAP_NAME ]
886
- postgres_snap .alias ("patronictl" )
887
- postgres_snap .alias ("psql" )
885
+ try :
886
+ postgres_snap .alias ("patronictl" )
887
+ except snap .SnapError :
888
+ logger .warning ("Unable to create patronictl alias" )
889
+ try :
890
+ postgres_snap .alias ("psql" )
891
+ except snap .SnapError :
892
+ logger .warning ("Unable to create psql alias" )
888
893
889
894
# Create the user home directory for the snap_daemon user.
890
895
# This is needed due to https://bugs.launchpad.net/snapd/+bug/2011581.
You can’t perform that action at this time.
0 commit comments