@@ -496,13 +496,13 @@ def main(args):
496496 _tmp_startup .append (BASE_TERMINATTR .format (_cv_node , _cv_auth ))
497497 create_output .append ('echo "{0}" > {1}/{2}/{3}/startup-config\n ' .format ('' .join (_tmp_startup ), CONFIGS , _tag , _node ))
498498 # Creating anchor containers
499-
499+ _dev_name_adusted = CEOS [ _node ]. ceos_name . replace ( "-" , "_" )
500500 create_output .append (f"echo \" Gathering patch cables for { _node } \" \n " )
501501 create_output .append ("# Getting {0} nodes plumbing\n " .format (_node ))
502502 create_output .append (f"{ cnt_cmd } run -d --restart=always { cnt_log } 10k --name={ CEOS [_node ].ceos_name } -net --net=none busybox /bin/init 1> /dev/null 2> /dev/null\n " )
503503 startup_output .append (f"{ cnt_cmd } start { CEOS [_node ].ceos_name } -net 1> /dev/null 2> /dev/null\n " )
504- create_output .append (f"{ CEOS [ _node ]. ceos_name } pid=$({ cnt_cmd } inspect --format '{{{{.State.Pid}}}}' { CEOS [_node ].ceos_name } -net)\n " )
505- create_output .append (f"sudo ln -sf /proc/${{{ CEOS [ _node ]. ceos_name } pid}}/ns/net /var/run/netns/{ CEOS [_node ].tag } { CEOS [_node ].dev_id } \n " )
504+ create_output .append (f"{ _dev_name_adusted } pid=$({ cnt_cmd } inspect --format '{{{{.State.Pid}}}}' { CEOS [_node ].ceos_name } -net)\n " )
505+ create_output .append (f"sudo ln -sf /proc/${{{ _dev_name_adusted } pid}}/ns/net /var/run/netns/{ CEOS [_node ].tag } { CEOS [_node ].dev_id } \n " )
506506 # Stop cEOS containers
507507 delete_output .append (f"echo \" Pulling power and removing patch cables from { _node } \" \n " )
508508 stop_output .append (f"echo \" Pulling power from { _node } \" \n " )
@@ -516,8 +516,8 @@ def main(args):
516516 delete_output .append (f"{ cnt_cmd } rm { CEOS [_node ].ceos_name } 1> /dev/null 2> /dev/null\n " )
517517 delete_output .append (f"{ cnt_cmd } rm { CEOS [_node ].ceos_name } -net 1> /dev/null 2> /dev/null\n " )
518518 delete_net_output .append (f"sudo rm -rf /var/run/netns/{ CEOS [_node ].tag } { CEOS [_node ].dev_id } \n " )
519- startup_output .append (f"{ CEOS [ _node ]. ceos_name } pid=$({ cnt_cmd } inspect --format '{{{{.State.Pid}}}}' { CEOS [_node ].ceos_name } -net)\n " )
520- startup_output .append (f"sudo ln -sf /proc/${{{ CEOS [ _node ]. ceos_name } pid}}/ns/net /var/run/netns/{ CEOS [_node ].tag } { CEOS [_node ].dev_id } \n " )
519+ startup_output .append (f"{ _dev_name_adusted } pid=$({ cnt_cmd } inspect --format '{{{{.State.Pid}}}}' { CEOS [_node ].ceos_name } -net)\n " )
520+ startup_output .append (f"sudo ln -sf /proc/${{{ _dev_name_adusted } pid}}/ns/net /var/run/netns/{ CEOS [_node ].tag } { CEOS [_node ].dev_id } \n " )
521521 create_output .append (f"# Connecting cEOS containers together\n " )
522522 # Output veth commands
523523 for _intf in CEOS [_node ].intfs :
0 commit comments