diff --git a/charms/nova-k8s/src/charm.py b/charms/nova-k8s/src/charm.py index 82e3e5b5..172124d1 100755 --- a/charms/nova-k8s/src/charm.py +++ b/charms/nova-k8s/src/charm.py @@ -862,7 +862,7 @@ class NovaOperatorCharm(sunbeam_charm.OSBaseOperatorAPICharm): if self.nova_spiceproxy_public_url: self.config_svc.interface.set_config( relation=event.relation, - nova_spiceproxy_url=self.nova_spiceproxy_public_url, + nova_spiceproxy_url=f"{self.nova_spiceproxy_public_url}/spice_auto.html", ) else: logging.debug("Nova spiceproxy not yet set, not sending config") @@ -872,7 +872,7 @@ class NovaOperatorCharm(sunbeam_charm.OSBaseOperatorAPICharm): if self.nova_spiceproxy_public_url: self.config_svc.interface.set_config( relation=None, - nova_spiceproxy_url=self.nova_spiceproxy_public_url, + nova_spiceproxy_url=f"{self.nova_spiceproxy_public_url}/spice_auto.html", ) else: logging.debug("Nova spiceproxy not yet set, not sending config") diff --git a/charms/openstack-hypervisor/src/charm.py b/charms/openstack-hypervisor/src/charm.py index 4f9aceb4..730c6106 100755 --- a/charms/openstack-hypervisor/src/charm.py +++ b/charms/openstack-hypervisor/src/charm.py @@ -505,7 +505,7 @@ class HypervisorOperatorCharm(sunbeam_charm.OSBaseOperatorCharm): try: if contexts.nova_service.nova_spiceproxy_url: return { - "compute.nova-spiceproxy-url": contexts.nova_service.nova_spiceproxy_url, + "compute.spice-proxy-url": contexts.nova_service.nova_spiceproxy_url, } except AttributeError as e: logger.debug(f"Nova service relation not integrated: {str(e)}") diff --git a/charms/openstack-hypervisor/tests/unit/test_charm.py b/charms/openstack-hypervisor/tests/unit/test_charm.py index 1d1c81e6..e2b8a082 100644 --- a/charms/openstack-hypervisor/tests/unit/test_charm.py +++ b/charms/openstack-hypervisor/tests/unit/test_charm.py @@ -115,7 +115,7 @@ class TestCharm(test_utils.CharmTestCase): "nova-service", "nova", app_data={ - "nova-spiceproxy-url": "http://INGRESS_IP/nova-spiceproxy" + "spice-proxy-url": "http://INGRESS_IP/nova-spiceproxy/spice_auto.html" }, ) @@ -147,7 +147,7 @@ class TestCharm(test_utils.CharmTestCase): "compute.rbd-user": "nova", "compute.rbd-secret-uuid": "ddd", "compute.rbd-key": "eee", - "compute.nova-spiceproxy-url": "http://INGRESS_IP/nova-spiceproxy", + "compute.spice-proxy-url": "http://INGRESS_IP/nova-spiceproxy/spice_auto.html", "credentials.ovn-metadata-proxy-shared-secret": metadata, "identity.admin-role": None, "identity.auth-url": "http://10.153.2.45:80/openstack-keystone", @@ -206,7 +206,7 @@ class TestCharm(test_utils.CharmTestCase): "nova-service", "nova", app_data={ - "nova-spiceproxy-url": "http://INGRESS_IP/nova-spiceproxy" + "spice-proxy-url": "http://INGRESS_IP/nova-spiceproxy/spiceauto.html" }, ) @@ -250,7 +250,7 @@ class TestCharm(test_utils.CharmTestCase): "compute.rbd-user": "nova", "compute.rbd-secret-uuid": "ddd", "compute.rbd-key": "eee", - "compute.nova-spiceproxy-url": "http://INGRESS_IP/nova-spiceproxy", + "compute.spice-proxy-url": "http://INGRESS_IP/nova-spiceproxy/spiceauto.html", "credentials.ovn-metadata-proxy-shared-secret": metadata, "identity.admin-role": None, "identity.auth-url": "http://10.153.2.45:80/openstack-keystone", diff --git a/libs/internal/lib/charms/nova_k8s/v0/nova_service.py b/libs/internal/lib/charms/nova_k8s/v0/nova_service.py index d2a32d24..907f4b2e 100644 --- a/libs/internal/lib/charms/nova_k8s/v0/nova_service.py +++ b/libs/internal/lib/charms/nova_k8s/v0/nova_service.py @@ -140,7 +140,7 @@ class NovaServiceProvides(Object): f"{relation.name}/{relation.id}" ) relation.data[self.charm.app][ - "nova-spiceproxy-url" + "spice-proxy-url" ] = nova_spiceproxy_url @@ -207,4 +207,4 @@ class NovaServiceRequires(Object): @property def nova_spiceproxy_url(self) -> str | None: """Return the nova_spiceproxy url.""" - return self.get_remote_app_data("nova-spiceproxy-url") + return self.get_remote_app_data("spice-proxy-url")