Created
September 24, 2012 10:02
-
-
Save changtimwu/3775251 to your computer and use it in GitHub Desktop.
bug of yamlparser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#External configurations from user | |
system : | |
sys : | |
name : "IES-2307C" | |
description : "V3.13 2012-03-01" | |
location : "Taiwan Taipei" | |
contact : "default" | |
timezone_offset : 0 | |
lldp : | |
sys : | |
enabled : true | |
update_time : 30 | |
ports : | |
- no : 1 | |
mode : "enabledRxTx" | |
- no : 2 | |
mode : "enabledRxTx" | |
- no : 3 | |
mode : "enabledRxTx" | |
- no : 4 | |
mode : "enabledRxTx" | |
- no : 5 | |
mode : "enabledRxTx" | |
- no : 6 | |
mode : "enabledRxTx" | |
- no : 7 | |
mode : "enabledRxTx" | |
- no : 8 | |
mode : "enabledRxTx" | |
- no : 9 | |
mode : "enabledRxTx" | |
- no : 10 | |
mode : "enabledRxTx" | |
- no : 11 | |
mode : "enabledRxTx" | |
- no : 12 | |
mode : "enabledRxTx" | |
cdp : | |
sys : | |
enabled : true | |
update_time : 60 | |
hold_time : 180 | |
ports : | |
- no : 1 | |
enabled : true | |
- no : 2 | |
enabled : true | |
- no : 3 | |
enabled : true | |
- no : 4 | |
enabled : true | |
- no : 5 | |
enabled : true | |
- no : 6 | |
enabled : true | |
- no : 7 | |
enabled : true | |
- no : 8 | |
enabled : true | |
- no : 9 | |
enabled : true | |
- no : 10 | |
enabled : true | |
- no : 11 | |
enabled : true | |
- no : 12 | |
enabled : true | |
vlan : | |
entries : | |
- vlan_enabled : true | |
type : "static" | |
id : 1 | |
snooping_enabled : true | |
querier_enabled : true | |
ports : [1,2,3,4,5,6,7,8,9,10,11,12] | |
- vlan_enabled : true | |
type : "static" | |
id : 10 | |
snooping_enabled : true | |
querier_enabled : true | |
ports : [9,11] | |
igmp : | |
sys : | |
querier_enabled : true | |
snooping_enabled : true | |
flooding_enabled : true | |
ports : | |
- no : 1 | |
is_router_port : false | |
fast_leave : true | |
- no : 2 | |
is_router_port : false | |
fast_leave : true | |
- no : 3 | |
is_router_port : false | |
fast_leave : true | |
- no : 4 | |
is_router_port : false | |
fast_leave : true | |
- no : 5 | |
is_router_port : false | |
fast_leave : true | |
- no : 6 | |
is_router_port : false | |
fast_leave : true | |
- no : 7 | |
is_router_port : false | |
fast_leave : true | |
- no : 8 | |
is_router_port : false | |
fast_leave : true | |
- no : 9 | |
is_router_port : false | |
fast_leave : true | |
- no : 10 | |
is_router_port : false | |
fast_leave : true | |
- no : 11 | |
is_router_port : false | |
fast_leave : true | |
- no : 12 | |
is_router_port : false | |
fast_leave : true | |
rstp : | |
sys : | |
mode : "RSTP" | |
priority : 32768 | |
vid : 0 | |
max_age : 20 | |
helloTime : 2 | |
forward_delay : 15 | |
ports : | |
- no : 1 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 2 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 3 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 4 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 5 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 6 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 7 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 8 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 9 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 10 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 11 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 12 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 13 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 14 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 15 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 16 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 17 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 18 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 19 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
- no : 20 | |
stp_enabled : true | |
path_cost : 20000 | |
priority : 128 | |
p2p_mode : "forceEnabled" | |
edge_enabled : false | |
port_ctrl : | |
sys : | |
auto_detect_enabled : true | |
ports : | |
- no : 1 | |
description : "#1" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 2 | |
description : "#2" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 3 | |
description : "#3" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 4 | |
description : "#4" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 5 | |
description : "#5" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 6 | |
description : "#6" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 7 | |
description : "#7" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 8 | |
description : "#8" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 9 | |
description : "#9" | |
enabled : true | |
untag_vid : 10 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 10 | |
description : "#10" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 11 | |
description : "#11" | |
enabled : true | |
untag_vid : 10 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
- no : 12 | |
description : "#12" | |
enabled : true | |
untag_vid : 1 | |
control : | |
speed : | |
conf : "auto" | |
flow_ctrl : | |
conf : false | |
max_frame : 9600 | |
rate_limit : | |
policer : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
shaper : | |
enabled : false | |
rate : 500 | |
unit : "kbps" | |
mirror : | |
egress : [] | |
ingress : [] | |
lacp : | |
sys : | |
smac_hash_enabled : true | |
dmac_hash_enabled : false | |
ipaddr_hash_enabled : true | |
portno_hash_enabled : false | |
groups : | |
- no : 1 | |
lacp_enabled : false | |
ports : [] | |
- no : 2 | |
lacp_enabled : false | |
ports : [] | |
- no : 3 | |
lacp_enabled : false | |
ports : [] | |
- no : 4 | |
lacp_enabled : false | |
ports : [] | |
- no : 5 | |
lacp_enabled : false | |
ports : [] | |
- no : 6 | |
lacp_enabled : false | |
ports : [] | |
- no : 7 | |
lacp_enabled : false | |
ports : [] | |
- no : 8 | |
lacp_enabled : false | |
ports : [] | |
mvr : | |
entries : [] | |
mac_filtering : | |
entries : [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yaml = require 'js-yaml' | |
yamlparser = require 'yamlparser' | |
fs = require 'fs' | |
fn = process.argv[2] | |
console.log 'fn=',fn | |
fc = fs.readFileSync fn, 'utf8' | |
jsyh = yaml.load fc | |
yph = yamlparser.eval fc | |
if process.argv[3]=='1' | |
console.log 'js-yaml:', jsyh #.port_ctrl.ports | |
else | |
console.log 'yamlparser:', yph #.port_ctrl.ports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a.json 2012-09-24 17:43:56.258589759 +0800 | |
+++ b.json 2012-09-24 17:44:00.886531578 +0800 | |
@@ -1,5 +1,5 @@ | |
fn= pconfig.yml | |
-js-yaml: { system: | |
+yamlparser: { system: | |
{ sys: | |
{ name: 'IES-2307C', | |
description: 'V3.13 2012-03-01', | |
@@ -98,7 +98,8 @@ | |
[Object], | |
[Object], | |
[Object], | |
- [Object] ], | |
+ [Object], | |
+ rate_limit: [Object] ], | |
mirror: { egress: [], ingress: [] } }, | |
lacp: | |
{ sys: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment