Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 1 | # Copyright 2016 Mirantis, 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 | import collections |
| 16 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 17 | |
| 18 | def enum(*values, **kwargs): |
| 19 | names = kwargs.get('names') |
| 20 | if names: |
| 21 | return collections.namedtuple('Enum', names)(*values) |
| 22 | return collections.namedtuple('Enum', values)(*values) |
| 23 | |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 24 | |
Dennis Dmitriev | 53d3b77 | 2016-10-18 14:31:58 +0300 | [diff] [blame] | 25 | UNDERLAY_NODE_ROLES = enum( |
Dennis Dmitriev | b5d7424 | 2016-10-18 14:05:29 +0300 | [diff] [blame] | 26 | 'salt_master', |
| 27 | 'salt_minion', |
vrovachev | 99228d3 | 2017-06-08 19:46:10 +0400 | [diff] [blame] | 28 | 'k8s_virtlet', |
Victor Ryzhenkin | 66d3937 | 2017-09-28 19:25:48 +0400 | [diff] [blame] | 29 | 'k8s_controller', |
Dennis Dmitriev | f3f90a5 | 2017-08-10 14:37:05 +0300 | [diff] [blame] | 30 | 'decapod_mon', |
| 31 | 'decapod_osd', |
| 32 | 'decapod_all', |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 33 | ) |
| 34 | |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 35 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 36 | NETWORK_TYPE = enum( |
Dennis Dmitriev | b6bcc5c | 2018-09-26 11:07:53 +0000 | [diff] [blame] | 37 | 'admin', |
| 38 | 'control', |
| 39 | 'tenant', |
| 40 | 'storage', |
| 41 | 'external', |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 42 | ) |
| 43 | |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 44 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 45 | SNAPSHOT = enum( |
| 46 | 'hardware', |
| 47 | 'underlay', |
Dennis Dmitriev | 010f4cd | 2016-11-01 20:43:51 +0200 | [diff] [blame] | 48 | 'salt_deployed', |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 49 | 'core_deployed', |
Dennis Dmitriev | eac3aab | 2017-07-12 16:36:41 +0300 | [diff] [blame] | 50 | 'oss_deployed', |
Dennis Dmitriev | 6ee7ca8 | 2018-03-26 14:14:37 +0300 | [diff] [blame] | 51 | 'drivetrain_deployed', |
Dennis Dmitriev | 010f4cd | 2016-11-01 20:43:51 +0200 | [diff] [blame] | 52 | 'openstack_deployed', |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 53 | 'stacklight_deployed', |
vrovachev | bc2f5ce | 2017-05-22 19:37:24 +0400 | [diff] [blame] | 54 | 'virtlet_deployed', |
Victor Ryzhenkin | 655587f | 2017-05-24 20:00:07 +0400 | [diff] [blame] | 55 | 'virtlet_ceph_deployed', |
Dennis Dmitriev | f3f90a5 | 2017-08-10 14:37:05 +0300 | [diff] [blame] | 56 | 'k8s_deployed', |
| 57 | 'decapod_deployed', |
Tatyana Leontovich | a754ce5 | 2017-11-13 16:46:43 +0200 | [diff] [blame] | 58 | 'ceph_deployed', |
Dmitry Tyzhnenko | 35413c0 | 2018-03-05 14:12:37 +0200 | [diff] [blame] | 59 | 'day1_underlay', |
| 60 | 'cfg_configured', |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 61 | ) |
| 62 | |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 63 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 64 | LOG_LEVELS = enum( |
| 65 | 'INFO', |
| 66 | 'WARNING', |
| 67 | 'ERROR', |
| 68 | 'CRITICAL', |
| 69 | 'DEBUG', |
| 70 | 'NOTE' |
| 71 | ) |