-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdebugri.py
executable file
·54 lines (47 loc) · 1.53 KB
/
debugri.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
import sys
from vertex_print import vertexPrint
from basevertex import baseVertex
from parser import ArgumentParser
import debugvn
from argparse import RawTextHelpFormatter
class debugVertexRI(baseVertex):
"""
Debug utility for Routing Instance.
This is RI vertex to get RI information from config, control and relevant compute nodes.
Input:
Mandatory: uuid | fq_name
Output:
Console output and contrail_debug_output.json, logs are at debug_nodes.log
Dependant vertexes:
VN
"""
vertex_type = 'routing-instance'
def __init__(self, **kwargs):
self.dependant_vertexes = [debugvn.debugVertexVN]
super(debugVertexRI, self).__init__(**kwargs)
def process_self(self, vertex):
pass
def get_schema(self, **kwargs):
#VN UUID, VMI UUID
schema_dict = {
"virtual-network": {
"uuid": 'routing_instances'
},
"virtual-machine-interface": {
"uuid": 'routing_instance_refs'
}
}
return schema_dict
def parse_args(args):
parser = ArgumentParser(description=debugVertexRI.__doc__, add_help=True, formatter_class=RawTextHelpFormatter)
parser.add_argument('--display_name', help='Display name')
return parser.parse_args(args)
if __name__ == '__main__':
args = parse_args(sys.argv[1:])
vRI= debugVertexRI(**args)
vP = vertexPrint(vRI)
vP.convert_json()