Update gns3dms to support cloud.conf

This commit is contained in:
Michael committed 2014-09-06 20:46:06 -06:00
1 parent 36e539382c
commit ef492d4690
7 files changed
+54 -40

No files matched your search

+2 -1
View File
@@ -20,8 +20,9 @@ from .base import IModule
from .dynamips import Dynamips
from .vpcs import VPCS
from .virtualbox import VirtualBox
from .deadman import DeadMan
MODULES = [Dynamips, VPCS, VirtualBox]
MODULES = [Dynamips, VPCS, VirtualBox, DeadMan]
if sys.platform.startswith("linux"):
# IOU runs only on Linux
+9 -3
View File
@@ -30,7 +30,7 @@ from gns3server.config import Config
import logging
log = logging.getLogger(__name__)
class DeadMan():
class DeadMan(IModule):
"""
DeadMan module.
@@ -51,10 +51,12 @@ class DeadMan():
self._heartbeat_file = "%s/heartbeat_file_for_gnsdms" % (
self._tempdir)
self.cloud_config = Config.instance().get_section_config("CLOUD_SERVER")
self._heartbeat_file = self.cloud_config["heartbeat_file"]
if 'heartbeat_file' in kwargs:
self._heartbeat_file = kwargs['heartbeat_file']
self._deadman_process = None
self.start()
@@ -63,8 +65,12 @@ class DeadMan():
Start a subprocess and return the object
"""
cmd = []
#gnsserver gets configuration options from cloud.conf. This is where
#the client adds specific cloud information.
#gns3dms also reads in cloud.conf. That is why we don't need to specific
#all the command line arguments here.
cmd = []
cmd.append("gns3dms")
cmd.append("--file %s" % (self._heartbeat_file))
cmd.append("--background")