Test exceptions

feature/node-rewrite
Sven Slootweg 13 years ago
parent fa2e12afc6
commit 050d8a27ac

@ -74,7 +74,7 @@ class Node extends CPHPDatabaseRecordClass
public function GetHostname() public function GetHostname()
{ {
return $this->ssh->RunCommandCached("hostname")->stdout; return $this->ssh->RunCommandCached("hostname2", true)->stdout;
} }
} }

@ -30,7 +30,7 @@ class SshConnector extends CPHPBaseClass
private $cache = ""; private $cache = "";
public function RunCommand($command, $throw_exception) public function RunCommand($command, $throw_exception = false)
{ {
try try
{ {
@ -56,7 +56,7 @@ class SshConnector extends CPHPBaseClass
} }
} }
public function RunCommandCached($command, $throw_exception) public function RunCommandCached($command, $throw_exception = false)
{ {
if(!isset($this->cache[$command])) if(!isset($this->cache[$command]))
{ {

@ -14,4 +14,5 @@
class SshConnectException extends Exception {} class SshConnectException extends Exception {}
class SshAuthException extends Exception {} class SshAuthException extends Exception {}
class SshCommandException extends Exception {} class SshCommandException extends Exception {}
class SshExitException extends Exception {}
?> ?>

Loading…
Cancel
Save