Files
Felipe Reyes 6671969b97 Add channel config option
The charm uses a hardcoded channel declared in src/layer.yaml with the
value 1.0/stable, this prevents users from overriding it. This became a
blocker with the release of octavia-diskimage-retrofit 2.0 in the `2.0`
track to support Ubuntu Noble 24.04, the snap migrated to core24[0][1]

This change introduces a new configuration option that defaults to null,
this will allow the charm to use the 1.0/stable channel when running on
Jammy and 2.0/stable when running on Noble. Existing environments
running on Jammy will see no behavior change, and no operator's
intervention is needed when upgrading.

[0] https://github.com/openstack-charmers/octavia-diskimage-retrofit/pull/44
[1] https://github.com/openstack-charmers/octavia-diskimage-retrofit/pull/46

Change-Id: I1ccba9de844f7900c9a8517fff4de2f8c4019871
Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com>

Co-Authored-by: Hemanth Nakkina <hemanth.nakkina@canonical.com>
Change-Id: I1ccba9de844f7900c9a8517fff4de2f8c4019871
Signed-off-by: Hemanth Nakkina <hemanth.nakkina@canonical.com>
2026-06-22 13:41:28 +05:30

41 lines
1.4 KiB
Python

# Copyright 2018 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from unittest import mock
import sys
sys.path.append('src')
sys.path.append('src/lib')
# Mock out charmhelpers so that we can test without it.
import charms_openstack.test_mocks # noqa
charms_openstack.test_mocks.mock_charmhelpers()
global glanceclient
global keystoneauth1
glanceclient = mock.MagicMock()
keystoneauth1 = mock.MagicMock()
sys.modules['glanceclient'] = glanceclient
sys.modules['keystoneauth1'] = keystoneauth1
sys.modules['keystoneauth1.loading'] = keystoneauth1.loading
sys.modules['keystoneauth1.session'] = keystoneauth1.session
# Mock out charms.layer modules
charms_layer = mock.MagicMock()
charms_layer_snap = mock.MagicMock()
charms_layer_basic = mock.MagicMock()
sys.modules['charms.layer'] = charms_layer
sys.modules['charms.layer.snap'] = charms_layer_snap
sys.modules['charms.layer.basic'] = charms_layer_basic