Fix provision write method to only write one device
This commit is contained in:
@@ -525,6 +525,7 @@
|
|||||||
if (!empty($settings->get('provision', 'path'))) {
|
if (!empty($settings->get('provision', 'path'))) {
|
||||||
$prov = new provision(['settings' => $settings]);
|
$prov = new provision(['settings' => $settings]);
|
||||||
$prov->domain_uuid = $domain_uuid;
|
$prov->domain_uuid = $domain_uuid;
|
||||||
|
$prov->device_uuid = $device_uuid;
|
||||||
$response = $prov->write();
|
$response = $prov->write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ class provision {
|
|||||||
/**
|
/**
|
||||||
* declare public variables
|
* declare public variables
|
||||||
*/
|
*/
|
||||||
|
public $device_uuid;
|
||||||
public $template_dir;
|
public $template_dir;
|
||||||
public $device_address;
|
public $device_address;
|
||||||
public $device_template;
|
public $device_template;
|
||||||
@@ -1521,9 +1522,11 @@ class provision {
|
|||||||
|
|
||||||
// get the devices from database
|
// get the devices from database
|
||||||
$sql = 'select * from v_devices ';
|
$sql = 'select * from v_devices ';
|
||||||
// $sql .= "where domain_uuid = :domain_uuid ";
|
$sql .= "where domain_uuid = :domain_uuid ";
|
||||||
// $parameters['domain_uuid'] = $this->domain_uuid;
|
$sql .= "and device_uuid = :device_uuid ";
|
||||||
$result = $this->database->select($sql, null, 'all');
|
$parameters['domain_uuid'] = $this->domain_uuid;
|
||||||
|
$parameters['device_uuid'] = $this->device_uuid;
|
||||||
|
$result = $this->database->select($sql, $parameters, 'all');
|
||||||
|
|
||||||
// process each device
|
// process each device
|
||||||
if (is_array($result)) {
|
if (is_array($result)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user