Skip to content

Commit

Permalink
Make sure the config for 2.2 (new location) can be edited from the menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Oct 31, 2019
1 parent 59fcf3d commit 46efea2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/update_2.2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if [[ ! $(which python3.6) ]]
then
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6 python3.6-dev python3.6-venv
sudo apt-get install -y python3.6 python3.6-dev python3.6-venv
sudo python3.6 -m ensurepip --upgrade
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/update_2.2dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [[ ! $(which python3.6) ]]
then
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6 python3.6-dev python3.6-venv
sudo apt-get install -y python3.6 python3.6-dev python3.6-venv
sudo python3.6 -m ensurepip --upgrade
fi

Expand Down
20 changes: 19 additions & 1 deletion scripts/welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import locale
import re
import os
import sys
import time
Expand Down Expand Up @@ -62,6 +63,18 @@ def write_config(config):
config.write(f)


def gns3_major_version():
"""
Returns the GNS3 major server version
"""

version = gns3_version()
if version:
match = re.search(r"\d+.\d+", version)
return match.group(0)
return ""


def gns3_version():
"""
Return the GNS3 server version
Expand Down Expand Up @@ -283,7 +296,12 @@ def edit_config():
"""
Edit GNS3 configuration file
"""
os.system("nano ~/.config/GNS3/gns3_server.conf")

major_version = gns3_major_version()
if major_version == "2.2":
os.system("nano ~/.config/GNS3/{}/gns3_server.conf".format(major_version))
else:
os.system("nano ~/.config/GNS3/gns3_server.conf")


def edit_network():
Expand Down

0 comments on commit 46efea2

Please sign in to comment.