Coverage for cfg_checker/modules/network/network_errors.py : 57%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import itertools
3from cfg_checker.helpers.errors import ErrorIndex
6_c = itertools.count(1)
9class NetworkErrors(ErrorIndex):
10 # error type codes here
11 NET_MTU_MISMATCH = next(_c)
12 NET_MTU_EMPTY = next(_c)
13 NET_NO_RC_IF_STATUS = next(_c)
14 NET_DUPLICATE_IF = next(_c)
15 NET_SUBNET_INTERSECT = next(_c)
16 NET_MASK_MISMATCH = next(_c)
17 NET_NODE_NON_RESPONSIVE = next(_c)
18 NET_NODE_UNEXPECTED_IF = next(_c)
19 NET_NO_RUNTIME_NETWORK = next(_c)
20 NET_UNEXPECTED_GATEWAY = next(_c)
21 NET_PING_SUCCESS = next(_c)
22 NET_PING_TIMEOUT = next(_c)
23 NET_PING_ERROR = next(_c)
24 NET_PING_NOT_RESOLVED = next(_c)
26 def __init__(self):
27 super(NetworkErrors, self).__init__("NET")
29 self.add_error_type(
30 self.NET_MTU_MISMATCH,
31 "MTU mismatch on runtime interface and in reclass"
32 )
33 self.add_error_type(
34 self.NET_MTU_EMPTY,
35 "MTU value is not 1500 on runtime and empty in reclass"
36 )
37 self.add_error_type(
38 self.NET_NO_RC_IF_STATUS,
39 "Reclass has no IF 'enable' status value"
40 )
41 self.add_error_type(
42 self.NET_DUPLICATE_IF,
43 "Duplicate interface specified"
44 )
45 self.add_error_type(
46 self.NET_SUBNET_INTERSECT,
47 "Subnets intersection detected"
48 )
49 self.add_error_type(
50 self.NET_MASK_MISMATCH,
51 "IFs mask settings for subnet is not the same"
52 )
53 self.add_error_type(
54 self.NET_NODE_NON_RESPONSIVE,
55 "Node failed to respond on at least one non-ping salt call"
56 )
57 self.add_error_type(
58 self.NET_NODE_UNEXPECTED_IF,
59 "Node has unexpected IF with mapped IP"
60 )
61 self.add_error_type(
62 self.NET_NO_RUNTIME_NETWORK,
63 "Reclass network not found in Runtime"
64 )
65 self.add_error_type(
66 self.NET_UNEXPECTED_GATEWAY,
67 "Runtime has unexpected gateway set for specific network"
68 )
69 self.add_error_type(
70 self.NET_PING_SUCCESS,
71 "Network Ping successfull"
72 )
73 self.add_error_type(
74 self.NET_PING_TIMEOUT,
75 "Ping Timeout from source to target"
76 )
77 self.add_error_type(
78 self.NET_PING_ERROR,
79 "Error while conducting ping"
80 )
81 self.add_error_type(
82 self.NET_PING_NOT_RESOLVED,
83 "Host not resolved while conducting Ping"
84 )
87del _c