web: removed version option from drush logger create
This commit is contained in:
parent
679fb06f5d
commit
1d205314a1
|
@ -12,7 +12,6 @@ function logger_drush_command() {
|
||||||
'description' => 'Create a new sensor node entry.',
|
'description' => 'Create a new sensor node entry.',
|
||||||
'arguments' => array(
|
'arguments' => array(
|
||||||
'serial' => 'Sensor node serial number.',
|
'serial' => 'Sensor node serial number.',
|
||||||
'version' => 'Software version number.',
|
|
||||||
'uid' => 'User ID.',
|
'uid' => 'User ID.',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -32,7 +31,7 @@ function logger_drush_command() {
|
||||||
/**
|
/**
|
||||||
* Drush command callbacks.
|
* Drush command callbacks.
|
||||||
*/
|
*/
|
||||||
function _logger_create($serial, $version = 0, $uid = 0) {
|
function _logger_create($serial, $uid = 0) {
|
||||||
// guard against duplicating entries for the same S/N
|
// guard against duplicating entries for the same S/N
|
||||||
$count = db_result(db_query("SELECT COUNT(device) FROM {logger_devices} WHERE serial = %d", $serial));
|
$count = db_result(db_query("SELECT COUNT(device) FROM {logger_devices} WHERE serial = %d", $serial));
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
|
@ -45,7 +44,7 @@ function _logger_create($serial, $version = 0, $uid = 0) {
|
||||||
$sha = md5(uniqid(rand(), TRUE));
|
$sha = md5(uniqid(rand(), TRUE));
|
||||||
$created = time();
|
$created = time();
|
||||||
|
|
||||||
$result = db_query("INSERT INTO {logger_devices} (device, serial, uid, sha, created, version) VALUES ('%s', %d, %d, '%s', %d, %d)", $device, $serial, $uid, $sha, $created, $version);
|
$result = db_query("INSERT INTO {logger_devices} (device, serial, uid, sha, created) VALUES ('%s', %d, %d, '%s', %d)", $device, $serial, $uid, $sha, $created);
|
||||||
if (!$result) drush_set_error('LOGGER_CREATE_DEVICE_ENTRY', dt('Error creating a device entry for @device.', array('@device' => $device)));
|
if (!$result) drush_set_error('LOGGER_CREATE_DEVICE_ENTRY', dt('Error creating a device entry for @device.', array('@device' => $device)));
|
||||||
|
|
||||||
// create an entry in the {logger_meters} table
|
// create an entry in the {logger_meters} table
|
||||||
|
|
Loading…
Reference in New Issue