Debian Codegraph @

neutron_fwaas/cmd/upgrade_checks/checks.py

raw symbols SCIP
1 # Copyright 2019 Red Hat Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
14
15 from neutron_lib.utils import upgrade_checks as base_checks
16 from oslo_config import cfg
17 from oslo_upgradecheck import upgradecheck
18
19 from neutron_fwaas._i18n import _
20
21
22 class Checks(base_checks.BaseChecks):
23
24 def get_checks(self):
25 return [
26 (_("Check FWaaS v1"), self.fwaas_v1_check)
27 ]
28
29 @staticmethod
30 def fwaas_v1_check(checker):
31 fwaas_v1_names = [
32 'firewall',
33 'neutron_fwaas.services.firewall.fwaas_plugin:FirewallPlugin']
34 for name in fwaas_v1_names:
35 if name in cfg.CONF.service_plugins:
36 return upgradecheck.Result(
37 upgradecheck.Code.FAILURE,
38 _("FWaaS v1 is removed. "
39 "FWaaS v2 should be used instead."))
40 return upgradecheck.Result(upgradecheck.Code.SUCCESS)