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 | |
| 17 | from enum import IntEnum |
| 18 | |
| 19 | |
| 20 | def enum(*values, **kwargs): |
| 21 | names = kwargs.get('names') |
| 22 | if names: |
| 23 | return collections.namedtuple('Enum', names)(*values) |
| 24 | return collections.namedtuple('Enum', values)(*values) |
| 25 | |
Dennis Dmitriev | 53d3b77 | 2016-10-18 14:31:58 +0300 | [diff] [blame] | 26 | UNDERLAY_NODE_ROLES = enum( |
Dennis Dmitriev | b5d7424 | 2016-10-18 14:05:29 +0300 | [diff] [blame] | 27 | 'salt_master', |
| 28 | 'salt_minion', |
vrovachev | 99228d3 | 2017-06-08 19:46:10 +0400 | [diff] [blame] | 29 | 'k8s_virtlet', |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 30 | ) |
| 31 | |
| 32 | NETWORK_TYPE = enum( |
| 33 | 'private', |
dis | c529838 | 2016-11-23 16:03:33 +0200 | [diff] [blame] | 34 | 'admin' |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 35 | ) |
| 36 | |
| 37 | SNAPSHOT = enum( |
| 38 | 'hardware', |
| 39 | 'underlay', |
Dennis Dmitriev | 010f4cd | 2016-11-01 20:43:51 +0200 | [diff] [blame] | 40 | 'salt_deployed', |
| 41 | 'common_services_deployed', |
| 42 | 'openstack_deployed', |
Tatyana Leontovich | 5acc82a | 2017-05-23 15:41:35 +0300 | [diff] [blame] | 43 | 'sl_deployed', |
vrovachev | bc2f5ce | 2017-05-22 19:37:24 +0400 | [diff] [blame] | 44 | 'virtlet_deployed', |
Victor Ryzhenkin | 655587f | 2017-05-24 20:00:07 +0400 | [diff] [blame] | 45 | 'virtlet_ceph_deployed', |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 46 | 'k8s_deployed' |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 47 | ) |
| 48 | |
| 49 | LOG_LEVELS = enum( |
| 50 | 'INFO', |
| 51 | 'WARNING', |
| 52 | 'ERROR', |
| 53 | 'CRITICAL', |
| 54 | 'DEBUG', |
| 55 | 'NOTE' |
| 56 | ) |