Enable Ussuri and Focal
Keep focal at dev-bundles until neighbouring charms are enabled. Change-Id: I5df8dfb9925d29e587fbd3b975b964be794e39a9
This commit is contained in:
parent
ecfc4bf49f
commit
4b1fbd5efb
|
@ -4,4 +4,6 @@
|
||||||
#
|
#
|
||||||
# Build requirements
|
# Build requirements
|
||||||
charm-tools>=2.4.4
|
charm-tools>=2.4.4
|
||||||
|
# importlib-resources 1.1.0 removed Python 3.5 support
|
||||||
|
importlib-resources<1.1.0
|
||||||
simplejson
|
simplejson
|
||||||
|
|
|
@ -11,11 +11,66 @@
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
import inspect
|
||||||
|
|
||||||
|
import charmhelpers.fetch as ch_fetch
|
||||||
|
|
||||||
import charms.ovn_charm
|
import charms.ovn_charm
|
||||||
|
|
||||||
|
|
||||||
class OVNChassisCharm(charms.ovn_charm.BaseOVNChassisCharm):
|
class OVNSubordinateChassisCharm(object):
|
||||||
|
"""Mix-in for subordinate-specific handling."""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_os_codename_package(package, codenames, fatal=True):
|
||||||
|
"""Override to conditionally decide based on packages in apt cache.
|
||||||
|
|
||||||
|
Please inspect parent method for documentation of parameters.
|
||||||
|
|
||||||
|
The parent method also requires a package to already be installed,
|
||||||
|
and on initial charm deploy the fall back is to retrieve information
|
||||||
|
from a source configuration option.
|
||||||
|
|
||||||
|
Since we are a subordinate charm, we do not have a source configuration
|
||||||
|
option, thus we want to make the decision based on what is currently
|
||||||
|
available in the system APT cache alone. Our principle charm should
|
||||||
|
already have configured the system with the desired UCA pocket enabled.
|
||||||
|
"""
|
||||||
|
# When the method is called outside of the context of the select
|
||||||
|
# release handler we do want it to assert presence of an installed
|
||||||
|
# package, as it is then used to detect available upgrades.
|
||||||
|
if (not inspect.currentframe().f_back.f_code.co_name == ''
|
||||||
|
'default_select_release'):
|
||||||
|
return super().get_os_codename_package(
|
||||||
|
package, codenames, fatal=fatal)
|
||||||
|
|
||||||
|
cache = ch_fetch.apt_cache()
|
||||||
|
try:
|
||||||
|
pkg = cache[package]
|
||||||
|
except KeyError:
|
||||||
|
if not fatal:
|
||||||
|
return
|
||||||
|
raise ValueError(
|
||||||
|
'Could not determine version of package with no installation '
|
||||||
|
'candidate: {}'.format(package))
|
||||||
|
ver = ch_fetch.apt_pkg.upstream_version(pkg.version)
|
||||||
|
major_ver = ver.split('.')[0]
|
||||||
|
if (package in codenames and
|
||||||
|
major_ver in codenames[package]):
|
||||||
|
return codenames[package][major_ver]
|
||||||
|
|
||||||
|
|
||||||
|
class TrainOVNChassisCharm(OVNSubordinateChassisCharm,
|
||||||
|
charms.ovn_charm.BaseTrainOVNChassisCharm):
|
||||||
# OpenvSwitch and OVN is distributed as part of the Ubuntu Cloud Archive
|
# OpenvSwitch and OVN is distributed as part of the Ubuntu Cloud Archive
|
||||||
# Pockets get their name from OpenStack releases
|
# Pockets get their name from OpenStack releases
|
||||||
release = 'train'
|
release = 'train'
|
||||||
name = 'ovn-chassis'
|
name = 'ovn-chassis'
|
||||||
|
|
||||||
|
|
||||||
|
class UssuriOVNChassisCharm(OVNSubordinateChassisCharm,
|
||||||
|
charms.ovn_charm.BaseUssuriOVNChassisCharm):
|
||||||
|
# OpenvSwitch and OVN is distributed as part of the Ubuntu Cloud Archive
|
||||||
|
# Pockets get their name from OpenStack releases
|
||||||
|
release = 'ussuri'
|
||||||
|
name = 'ovn-chassis'
|
||||||
|
|
|
@ -9,6 +9,7 @@ tags:
|
||||||
series:
|
series:
|
||||||
- bionic
|
- bionic
|
||||||
- eoan
|
- eoan
|
||||||
|
- focal
|
||||||
subordinate: true
|
subordinate: true
|
||||||
extra-bindings:
|
extra-bindings:
|
||||||
data:
|
data:
|
||||||
|
|
|
@ -23,8 +23,10 @@ applications:
|
||||||
options:
|
options:
|
||||||
source: cloud:bionic-train
|
source: cloud:bionic-train
|
||||||
magpie:
|
magpie:
|
||||||
charm: cs:~admcleod/magpie
|
charm: cs:~openstack-charmers-next/magpie
|
||||||
num_units: 2
|
num_units: 2
|
||||||
|
options:
|
||||||
|
source: cloud:bionic-train
|
||||||
ovn-chassis:
|
ovn-chassis:
|
||||||
series: bionic
|
series: bionic
|
||||||
charm: cs:~openstack-charmers-next/ovn-chassis
|
charm: cs:~openstack-charmers-next/ovn-chassis
|
|
@ -0,0 +1,32 @@
|
||||||
|
series: bionic
|
||||||
|
relations:
|
||||||
|
- - vault:shared-db
|
||||||
|
- mysql:shared-db
|
||||||
|
- - ovn-central:certificates
|
||||||
|
- vault:certificates
|
||||||
|
- - magpie:juju-info
|
||||||
|
- ovn-chassis:juju-info
|
||||||
|
- - ovn-chassis:ovsdb
|
||||||
|
- ovn-central:ovsdb
|
||||||
|
- - ovn-chassis:certificates
|
||||||
|
- vault:certificates
|
||||||
|
applications:
|
||||||
|
mysql:
|
||||||
|
charm: cs:~openstack-charmers-next/percona-cluster
|
||||||
|
num_units: 1
|
||||||
|
vault:
|
||||||
|
charm: cs:~openstack-charmers-next/vault
|
||||||
|
num_units: 1
|
||||||
|
ovn-central:
|
||||||
|
charm: cs:~openstack-charmers-next/ovn-central
|
||||||
|
num_units: 3
|
||||||
|
options:
|
||||||
|
source: cloud:bionic-ussuri/proposed
|
||||||
|
magpie:
|
||||||
|
charm: cs:~openstack-charmers-next/magpie
|
||||||
|
num_units: 2
|
||||||
|
options:
|
||||||
|
source: cloud:bionic-ussuri/proposed
|
||||||
|
ovn-chassis:
|
||||||
|
series: bionic
|
||||||
|
charm: cs:~openstack-charmers-next/ovn-chassis
|
|
@ -1,7 +1,9 @@
|
||||||
series: eoan
|
series: eoan
|
||||||
relations:
|
relations:
|
||||||
|
- - vault-mysql-router:db-router
|
||||||
|
- mysql-innodb-cluster:db-router
|
||||||
- - vault:shared-db
|
- - vault:shared-db
|
||||||
- mysql:shared-db
|
- vault-mysql-router:shared-db
|
||||||
- - ovn-central:certificates
|
- - ovn-central:certificates
|
||||||
- vault:certificates
|
- vault:certificates
|
||||||
- - magpie:juju-info
|
- - magpie:juju-info
|
||||||
|
@ -11,9 +13,11 @@ relations:
|
||||||
- - ovn-chassis:certificates
|
- - ovn-chassis:certificates
|
||||||
- vault:certificates
|
- vault:certificates
|
||||||
applications:
|
applications:
|
||||||
mysql:
|
mysql-innodb-cluster:
|
||||||
charm: cs:~openstack-charmers-next/mysql-innodb-cluster
|
charm: cs:~openstack-charmers-next/mysql-innodb-cluster
|
||||||
num_units: 3
|
num_units: 3
|
||||||
|
vault-mysql-router:
|
||||||
|
charm: cs:~openstack-charmers-next/mysql-router
|
||||||
vault:
|
vault:
|
||||||
charm: cs:~openstack-charmers-next/vault
|
charm: cs:~openstack-charmers-next/vault
|
||||||
num_units: 1
|
num_units: 1
|
||||||
|
@ -21,7 +25,7 @@ applications:
|
||||||
charm: cs:~openstack-charmers-next/ovn-central
|
charm: cs:~openstack-charmers-next/ovn-central
|
||||||
num_units: 3
|
num_units: 3
|
||||||
magpie:
|
magpie:
|
||||||
charm: cs:~admcleod/magpie
|
charm: cs:~openstack-charmers-next/magpie
|
||||||
num_units: 2
|
num_units: 2
|
||||||
ovn-chassis:
|
ovn-chassis:
|
||||||
series: eoan
|
series: eoan
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
series: focal
|
||||||
|
relations:
|
||||||
|
- - vault-mysql-router:db-router
|
||||||
|
- mysql-innodb-cluster:db-router
|
||||||
|
- - vault:shared-db
|
||||||
|
- vault-mysql-router:shared-db
|
||||||
|
- vault:certificates
|
||||||
|
- - magpie:juju-info
|
||||||
|
- ovn-chassis:juju-info
|
||||||
|
- - ovn-chassis:ovsdb
|
||||||
|
- ovn-central:ovsdb
|
||||||
|
- - ovn-chassis:certificates
|
||||||
|
- vault:certificates
|
||||||
|
applications:
|
||||||
|
mysql-innodb-cluster:
|
||||||
|
charm: cs:~openstack-charmers-next/mysql-innodb-cluster
|
||||||
|
num_units: 3
|
||||||
|
vault-mysql-router:
|
||||||
|
charm: cs:~openstack-charmers-next/mysql-router
|
||||||
|
vault:
|
||||||
|
charm: cs:~openstack-charmers-next/vault
|
||||||
|
num_units: 1
|
||||||
|
ovn-central:
|
||||||
|
charm: cs:~openstack-charmers-next/ovn-central
|
||||||
|
num_units: 3
|
||||||
|
magpie:
|
||||||
|
charm: cs:~openstack-charmers-next/magpie
|
||||||
|
num_units: 2
|
||||||
|
ovn-chassis:
|
||||||
|
series: focal
|
||||||
|
charm: cs:~openstack-charmers-next/ovn-chassis
|
|
@ -1,9 +1,12 @@
|
||||||
charm_name: ovn-chassis
|
charm_name: ovn-chassis
|
||||||
gate_bundles:
|
gate_bundles:
|
||||||
|
- bionic-train
|
||||||
- eoan
|
- eoan
|
||||||
- bionic
|
- bionic-ussuri
|
||||||
smoke_bundles:
|
smoke_bundles:
|
||||||
- bionic
|
- bionic-ussuri
|
||||||
|
dev_bundles:
|
||||||
|
- focal
|
||||||
target_deploy_status:
|
target_deploy_status:
|
||||||
magpie:
|
magpie:
|
||||||
workload-status-message: icmp ok
|
workload-status-message: icmp ok
|
||||||
|
|
|
@ -3,11 +3,10 @@
|
||||||
# requirements management in charms via bot-control. Thank you.
|
# requirements management in charms via bot-control. Thank you.
|
||||||
#
|
#
|
||||||
# Lint and unit test requirements
|
# Lint and unit test requirements
|
||||||
flake8>=2.2.4,<=2.4.1
|
|
||||||
stestr>=2.2.0
|
|
||||||
requests>=2.18.4
|
|
||||||
charms.reactive
|
|
||||||
mock>=1.2
|
|
||||||
nose>=1.3.7
|
|
||||||
coverage>=3.6
|
coverage>=3.6
|
||||||
|
mock>=1.2
|
||||||
|
pep8>=1.7.0
|
||||||
|
flake8>=2.2.4
|
||||||
|
os-testr>=0.4.1
|
||||||
|
|
||||||
git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack
|
git+https://github.com/openstack/charms.openstack.git#egg=charms.openstack
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -77,4 +77,4 @@ commands = {posargs}
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
# E402 ignore necessary for path append before sys module import in actions
|
# E402 ignore necessary for path append before sys module import in actions
|
||||||
ignore = E402
|
ignore = E402,W504
|
||||||
|
|
|
@ -22,21 +22,45 @@ import charms_openstack.test_mocks # noqa
|
||||||
charms_openstack.test_mocks.mock_charmhelpers()
|
charms_openstack.test_mocks.mock_charmhelpers()
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
import charms
|
|
||||||
|
|
||||||
|
class _fake_decorator(object):
|
||||||
|
|
||||||
|
def __init__(self, *args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def __call__(self, f):
|
||||||
|
return f
|
||||||
|
|
||||||
|
|
||||||
|
charms = mock.MagicMock()
|
||||||
|
sys.modules['charms'] = charms
|
||||||
charms.leadership = mock.MagicMock()
|
charms.leadership = mock.MagicMock()
|
||||||
keystoneauth1 = mock.MagicMock()
|
|
||||||
neutronclient = mock.MagicMock()
|
|
||||||
sys.modules['charms.leadership'] = charms.leadership
|
sys.modules['charms.leadership'] = charms.leadership
|
||||||
keystoneauth1 = mock.MagicMock()
|
charms.reactive = mock.MagicMock()
|
||||||
novaclient = mock.MagicMock()
|
charms.reactive.when = _fake_decorator
|
||||||
neutron_lib = mock.MagicMock()
|
charms.reactive.when_all = _fake_decorator
|
||||||
|
charms.reactive.when_any = _fake_decorator
|
||||||
|
charms.reactive.when_not = _fake_decorator
|
||||||
|
charms.reactive.when_none = _fake_decorator
|
||||||
|
charms.reactive.when_not_all = _fake_decorator
|
||||||
|
charms.reactive.not_unless = _fake_decorator
|
||||||
|
charms.reactive.when_file_changed = _fake_decorator
|
||||||
|
charms.reactive.collect_metrics = _fake_decorator
|
||||||
|
charms.reactive.meter_status_changed = _fake_decorator
|
||||||
|
charms.reactive.only_once = _fake_decorator
|
||||||
|
charms.reactive.hook = _fake_decorator
|
||||||
|
charms.reactive.bus = mock.MagicMock()
|
||||||
|
charms.reactive.flags = mock.MagicMock()
|
||||||
|
charms.reactive.relations = mock.MagicMock()
|
||||||
|
sys.modules['charms.reactive'] = charms.reactive
|
||||||
|
sys.modules['charms.reactive.bus'] = charms.reactive.bus
|
||||||
|
sys.modules['charms.reactive.bus'] = charms.reactive.decorators
|
||||||
|
sys.modules['charms.reactive.flags'] = charms.reactive.flags
|
||||||
|
sys.modules['charms.reactive.relations'] = charms.reactive.relations
|
||||||
sys.modules['charms.leadership'] = charms.leadership
|
sys.modules['charms.leadership'] = charms.leadership
|
||||||
sys.modules['keystoneauth1'] = keystoneauth1
|
netaddr = mock.MagicMock()
|
||||||
sys.modules['novaclient'] = novaclient
|
sys.modules['netaddr'] = netaddr
|
||||||
sys.modules['neutronclient'] = neutronclient
|
|
||||||
sys.modules['neutronclient.v2_0'] = neutronclient.v2_0
|
|
||||||
sys.modules['neutron_lib'] = neutron_lib
|
|
||||||
sys.modules['neutron_lib.constants'] = neutron_lib.constants
|
|
||||||
import reactive
|
import reactive
|
||||||
reactive.ovn_chassis_charm_handlers = mock.MagicMock()
|
reactive.ovn_chassis_charm_handlers = mock.MagicMock()
|
||||||
reactive.ovn_chassis_charm_handlers.OVN_CHASSIS_ENABLE_HANDLERS_FLAG = \
|
reactive.ovn_chassis_charm_handlers.OVN_CHASSIS_ENABLE_HANDLERS_FLAG = \
|
||||||
|
|
Loading…
Reference in New Issue