GNS3 / gns3-gui

GNS3 Graphical Network Simulator
http://www.gns3.com
GNU General Public License v3.0
2.12k stars 433 forks source link

Investigate why we need 3 variables to handle the VPCS startup_script #324

Closed grossmj closed 9 years ago

grossmj commented 9 years ago

https://github.com/GNS3/gns3-gui/blob/master/gns3/modules/vpcs/vpcs_device.py#L50

We have script_file, startup_script and startup_script_path ;) We should at least get rid of one.

boenrobot commented 9 years ago

On a quick inspection:

"script_file" is the file name, but it's not checked whether it exists or not, until it's time to actually read it. "startup_script" is the actual contents of the file, once read (None beforehand or if the file doesn't exist), and ready to be applied if necessary. "startup_script_path" I'm guessing was meant to hold the path to the file, but it's ultimately unused. Instead, "script_file" contains the full path and file name (or at least, it is assumed to). So that's the one that can be safely removed. I also checked - it's not used anywhere else in the whole gns3-gui project.

julien-duponchelle commented 9 years ago

For me:

julien-duponchelle commented 9 years ago

But you are right we don't need that in init

julien-duponchelle commented 9 years ago

Thanks for the help @boenrobot