Skip to content

Commit

Permalink
chore: move openstack handle to on_install hook
Browse files Browse the repository at this point in the history
  • Loading branch information
yanksyoon committed Mar 7, 2024
1 parent 0a08ace commit 4916391
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,36 +552,6 @@ def _on_config_changed(self, _event: ConfigChangedEvent) -> None:
state = self._setup_state()
self._refresh_firewall(state)

if state.charm_config.openstack_clouds_yaml:
# Only build it in test mode since it may interfere with users systems.
if self.config.get("test-mode") == "insecure":
github = GithubClient(token=state.charm_config.token)
image = openstack_manager.build_image(
arch=state.arch,
cloud_config=state.charm_config.openstack_clouds_yaml,
github_client=github,
path=state.charm_config.path,
proxies=state.proxy_config,
)
instance_config = openstack_manager.create_instance_config(
unit_name=self.unit.name,
openstack_image=image,
path=state.charm_config.path,
github_client=github,
)
instance = openstack_manager.create_instance(
cloud_config=state.charm_config.openstack_clouds_yaml,
instance_config=instance_config,
)
logger.info("OpenStack instance: %s", instance)
# Test out openstack integration and then go
# into BlockedStatus as it is not supported yet
self.unit.status = BlockedStatus(
"OpenStack integration is not supported yet. "
"Please remove the openstack-clouds-yaml config."
)
return

runner_manager = self._get_runner_manager(state)
self._reconcile_runners(
runner_manager,
Expand Down

0 comments on commit 4916391

Please sign in to comment.