blob: 1e3f900edebfeb7c18b4833fa88880323b09ab3c [file] [log] [blame]
Dennis Dmitriev6f59add2016-10-18 13:45:27 +03001# 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
15import collections
16
17from enum import IntEnum
18
19
20def 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 Dmitriev53d3b772016-10-18 14:31:58 +030026UNDERLAY_NODE_ROLES = enum(
Dennis Dmitrievb5d74242016-10-18 14:05:29 +030027 'salt_master',
28 'salt_minion',
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030029)
30
31NETWORK_TYPE = enum(
32 'private',
disc5298382016-11-23 16:03:33 +020033 'admin'
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030034)
35
36SNAPSHOT = enum(
37 'hardware',
38 'underlay',
Dennis Dmitriev010f4cd2016-11-01 20:43:51 +020039 'salt_deployed',
40 'common_services_deployed',
41 'openstack_deployed',
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030042)
43
44LOG_LEVELS = enum(
45 'INFO',
46 'WARNING',
47 'ERROR',
48 'CRITICAL',
49 'DEBUG',
50 'NOTE'
51)