blob: ee07e0cd99b22b47f53a88ab90fd859624c45d1b [file] [log] [blame]
Srikanth Vavilapalli1725e492014-12-01 17:50:52 -08001#
2# Copyright (c) 2012,2013 Big Switch Networks, Inc.
3#
4# Licensed under the Eclipse Public License, Version 1.0 (the
5# "License"); you may not use this file except in compliance with the
6# License. You may obtain a copy of the License at
7#
8# http://www.eclipse.org/legal/epl-v10.html
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13# implied. See the License for the specific language governing
14# permissions and limitations under the License.
15#
16
17# show running tech_support_config [as]
18#
19
20import run_config
21import utif
22
23def running_config_tech_support(context, config, words):
24 # waiting for new tag-mapping to arrive to rewrite
25 try:
26 tech_support_entries = context.get_table_from_store('tech-support-config')
27 except Exception, e:
28 tech_support_entries = []
29 t_config = []
30 for ts_entry in tech_support_entries:
31 t_config.append("tech-support-config %s '%s'\n" % (ts_entry['cmd-type'], utif.quote_string(ts_entry['cmd'])))
32 if len(t_config) > 0:
33 config.append('!\n')
34 config += t_config
35
36
37tag_running_config_tuple = (
38 (
39 {
40 'optional' : False,
41 'field' : 'running-config',
42 'type' : 'enum',
43 'values' : 'tech-support',
44 'short-help' : 'Configuration for tech support',
45 'doc' : 'running-config|show-tech-support',
46 },
47 ),
48 )
49
50#
51# Register with run_config module, our callback to process running configs for
52# address-space configuration items
53#
54run_config.register_running_config('tech-support', 20000, None,
55 running_config_tech_support,
56 tag_running_config_tuple)
57