From cf59240befb7f0395cd5b555ec28a3c4059ebb17 Mon Sep 17 00:00:00 2001 From: Jerry Seutter Date: Sun, 21 Sep 2014 21:41:51 -0600 Subject: [PATCH] Bugfixes with cloud server communication --- cloud-image/script_template | 4 +--- gns3dms/main.py | 6 +++--- gns3server/modules/deadman/__init__.py | 4 ++-- gns3server/start_server.py | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/cloud-image/script_template b/cloud-image/script_template index e7c5ad56..c59fbbe6 100644 --- a/cloud-image/script_template +++ b/cloud-image/script_template @@ -11,9 +11,7 @@ mkdir -p /opt/gns3 pushd /opt/gns3 git clone --branch ${git_branch} ${git_url} cd gns3-server -pip3 install tornado -pip3 install pyzmq -pip3 install jsonschema +pip3 install -r dev-requirements.txt python3 ./setup.py install ${rc_local} diff --git a/gns3dms/main.py b/gns3dms/main.py index 50c012db..1e86cbac 100644 --- a/gns3dms/main.py +++ b/gns3dms/main.py @@ -219,19 +219,19 @@ def get_gns3secrets(cmd_line_option_list): """ gns3secret_paths = [ - os.path.expanduser("~/"), + os.path.join(os.path.expanduser("~"), '.config', 'GNS3'), SCRIPT_PATH, ] config = configparser.ConfigParser() for gns3secret_path in gns3secret_paths: - gns3secret_file = "%s/.gns3secrets.conf" % (gns3secret_path) + gns3secret_file = "%s/cloud.conf" % (gns3secret_path) if os.path.isfile(gns3secret_file): config.read(gns3secret_file) try: - for key, value in config.items("Cloud"): + for key, value in config.items("CLOUD_SERVER"): cmd_line_option_list[key] = value.strip() except configparser.NoSectionError: pass diff --git a/gns3server/modules/deadman/__init__.py b/gns3server/modules/deadman/__init__.py index 6fd30baa..c5619c96 100644 --- a/gns3server/modules/deadman/__init__.py +++ b/gns3server/modules/deadman/__init__.py @@ -83,7 +83,7 @@ class DeadMan(IModule): cmd.append("--file") cmd.append("%s" % (self._heartbeat_file)) cmd.append("--background") - log.debug("Deadman: Running command: %s"%(cmd)) + log.info("Deadman: Running command: %s"%(cmd)) process = subprocess.Popen(cmd, stderr=subprocess.STDOUT, shell=False) return process @@ -97,7 +97,7 @@ class DeadMan(IModule): cmd.append("gns3dms") cmd.append("-k") - log.debug("Deadman: Running command: %s"%(cmd)) + log.info("Deadman: Running command: %s"%(cmd)) process = subprocess.Popen(cmd, shell=False) return process diff --git a/gns3server/start_server.py b/gns3server/start_server.py index 099c3966..279ccbc3 100644 --- a/gns3server/start_server.py +++ b/gns3server/start_server.py @@ -168,7 +168,7 @@ def _start_gns3server(): cmd = [] cmd.append("gns3server") - log.debug("Starting gns3server ...") + log.info("Starting gns3server ...") subprocess.Popen(cmd, shell=False) @@ -203,7 +203,7 @@ def main(): except FileExistsError: pass - (server_key, server_crt ) = _generate_certs() + (server_key, server_crt) = _generate_certs() cloud_config = configparser.ConfigParser() cloud_config['CLOUD_SERVER'] = {}