[openstack-hypervisor] install hypervisor snap during install hook
Change-Id: I22bfa2308b3c3acfdc72b7c3792aadc5533144a8 Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
This commit is contained in:
parent
e5fb16d6b9
commit
2250c83f1c
@ -174,6 +174,10 @@ class HypervisorOperatorCharm(sunbeam_charm.OSBaseOperatorCharm):
|
||||
self.on.set_hypervisor_local_settings_action,
|
||||
self._set_hypervisor_local_settings_action,
|
||||
)
|
||||
self.framework.observe(
|
||||
self.on.install,
|
||||
self._on_install,
|
||||
)
|
||||
self.framework.observe(
|
||||
self.on.cos_agent_relation_joined,
|
||||
self._on_cos_agent_relation_joined,
|
||||
@ -191,6 +195,10 @@ class HypervisorOperatorCharm(sunbeam_charm.OSBaseOperatorCharm):
|
||||
],
|
||||
)
|
||||
|
||||
def _on_install(self, _: ops.InstallEvent):
|
||||
"""Run install on this unit."""
|
||||
self.ensure_snap_present()
|
||||
|
||||
@property
|
||||
def migration_address(self) -> Optional[str]:
|
||||
"""Get address from migration binding."""
|
||||
@ -351,7 +359,7 @@ class HypervisorOperatorCharm(sunbeam_charm.OSBaseOperatorCharm):
|
||||
)
|
||||
except snap.SnapError as e:
|
||||
logger.error(
|
||||
"An exception occurred when installing charmcraft. Reason: %s",
|
||||
"An exception occurred when installing openstack-hypervisor. Reason: %s",
|
||||
e.message,
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user