Exemple #1
0
    def _launch(self, timeout=30):
        if not self.dependenciesEnabled():
            return

        # convert from string name to managed class
        connectedToDeviceName = self.connectedTo()
        connectedToDevice = self._pnms.getDevice(connectedToDeviceName)

        if not connectedToDevice.enabled():
            raise Exception("Cannot enable VNIC until {} is enabled.".format(
                connectedToDevice.name()))
        connAddress, connPort = connectedToDevice.tcpLocation()

        # A connAddress of None means the "public" interface. Should still
        # be able to connect via localhost
        if connAddress == None:
            connAddress = "127.0.0.1"

        vnicAddress = self._config["playground_address"]

        portFile, pidFile, lockFile = self._getDeviceRunFiles()

        cmdArgs = self._buildLaunchCommand(pidFile, portFile, vnicAddress,
                                           connAddress, str(connPort))
        getCmdOutput(*cmdArgs)

        running = self._waitUntilRunning(timeout=timeout)
        if not running:
            self._shutdown()
        else:
            self._pnms.postAlert(self.enable, True)
Exemple #2
0
    def _launch(self, timeout=30):
        if not self.dependenciesEnabled():
            return
        if self.isRemote():
            raise Exception("Cannot launch remote unreliable switches")
        elif self.isManaged():
            port = "0" # pick next free port
        else:
            port = self._config[self.CONFIG_OPTION_PORT]
        
        portFile, pidFile, lockFile = self._getDeviceRunFiles()

        
        cmdArgs = self._buildLaunchCommand(pidFile, portFile, port)
        
        if self.isLocal():
            cmdArgs.append("--private")
        
        getCmdOutput(*cmdArgs)
        
        running = self._waitUntilRunning(timeout=timeout)
        if not running:
            self._shutdown()
        else:
            self._pnms.postAlert(self.enable, True)
    def _launch(self, timeout=30):
        if not self.dependenciesEnabled():
            return
        if self.isRemote():
            raise Exception("Cannot launch remote switches")
        elif self.isManaged():
            port = "0" # pick next free port
        else:
            port = self._config[self.CONFIG_OPTION_PORT]
        
        portFile, pidFile, lockFile = self._getDeviceRunFiles()

        
        cmdArgs = self._buildLaunchCommand(pidFile, portFile, port)
        getCmdOutput(*cmdArgs)
        
        running = self._waitUntilRunning(timeout=timeout)
        if not running:
            self._shutdown()
        else:
            self._pnms.postAlert(self.enable, True)
Exemple #4
0
 def _launch(self, timeout=30):
     if not self.dependenciesEnabled():
         return
     
     # convert from string name to managed class
     connectedToDeviceName = self.connectedTo()
     connectedToDevice = self._pnms.getDevice(connectedToDeviceName)
     
     if not connectedToDevice.enabled():
         raise Exception("Cannot enable VNIC until {} is enabled.".format(connectedToDevice.name()))
     connAddress, connPort = connectedToDevice.tcpLocation()
     
     vnicAddress = self._config["playground_address"]
     
     portFile, pidFile, lockFile = self._getDeviceRunFiles()
     
     cmdArgs = self._buildLaunchCommand(pidFile, portFile, vnicAddress, connAddress, str(connPort))
     getCmdOutput(*cmdArgs)
     
     running = self._waitUntilRunning(timeout=timeout)
     if not running:
         self._shutdown()
     else:
         self._pnms.postAlert(self.enable, True)