Node class prototype

feature/node-rewrite
Sven Slootweg 13 years ago
parent 1b8a9f2d19
commit 03a518814a

@ -15,6 +15,25 @@ if(!isset($_CVM)) { die("Unauthorized."); }
class Node extends CPHPDatabaseRecordClass
{
public $table_name = "nodes";
public $fill_query = "SELECT * FROM {$table_name} WHERE `Id` = '%d'";
public $verify_query = "SELECT * FROM {$table_name} WHERE `Id` = '%d'";
public $prototype = array(
'string' => array(
'Name' => "Name",
'Hostname' => "Hostname",
'PrivateKey' => "CustomPrivateKey",
'PublicKey' => "CustomPublicKey"
),
'numeric' => array(
'Port' => "Port"
),
'boolean' => array(
'HasCustomKey' => "HasCustomKey"
)
);
public $ssh = null;
}

@ -41,8 +41,7 @@ class SshConnector extends CPHPBaseClass
}
catch (SshCommandException $e)
{
$error = $e->getMessage();
throw new SshCommandException($error);
throw new SshCommandException($e->getMessage());
}
catch (SshConnectException $e)
{
@ -51,8 +50,7 @@ class SshConnector extends CPHPBaseClass
}
catch (SshExitException $e)
{
$error = $e->getMessage();
throw new SshExitException($error);
throw new SshExitException($e->getMessage(), $e->getCode());
}
}

Loading…
Cancel
Save