add config file support#42
Conversation
| return p, args, env | ||
|
|
||
| def parse_routes_from_list(args, routes): | ||
| for x in routes: |
There was a problem hiding this comment.
Parameter x need to parse by net_or_host_param() before checking.
Otherwise it will not handle the subnet and alias cases.
|
Any idea what would the startup performance looks like when putting in a large configuration file? |
|
for my use case I try with 10-20 lines, if you need 10k line are you sure you need to slice the vpn tunel? I will check the performance when I get some time. |
|
I tested the file parsing, here are the results:
got config file: vpn_slice_10.txt
elapsed time: 8.869171142578125e-05 s; number lines: 10
Must be called as vpnc-script, with $reason set; use --help for more information
got config file: vpn_slice_10k.txt
elapsed time: 0.0041501522064208984 s; number lines: 10000
Must be called as vpnc-script, with $reason set; use --help for more informationthe bottle neck should be somewhere else, not in the file parsing |
|
Is there a reason that you wrote this to accept only routes/hostnames/aliases in the configuration file, and not other arbitrary arguments? |
|
no reason, I took the idea from here #17 (comment) |
|
last commit d988aa3 enable from_prefix_chars option for ArgumentParser which enable the parse from file by prefixing the character "@" to config filename vpn-slice @list_of_routes.txtwith this change, option --config could be remove, what do you think? |
first implementation for config file support issue #17