* [story#60132,done,4h,0h] variable naming adjustment.

This commit is contained in:
zhaixiaojian
2024-07-16 09:08:48 +08:00
committed by 丁国栋
parent f7f15e34f6
commit c70aeb1596
2 changed files with 18 additions and 18 deletions
+15 -15
View File
@@ -272,14 +272,14 @@ class instanceModel extends model
$settings->settings_map->resources = new stdclass;
$settings->settings_map->resources->memory = $size;
$oldVal = helper::formatKB($instance->oldVal);
$newVal = helper::formatKB(intval($size));
unset($instance->oldVal);
$oldValue = helper::formatKB($instance->oldVal);
$newValue = helper::formatKB(intval($size));
unset($instance->oldValue);
$success = $this->cne->updateConfig($instance, $settings);
if($success)
{
$actionID = $this->action->create('instance', $instance->id, 'adjustMemory', $newVal);
$this->action->logHistory($actionID, [['field' => 'adjustmemory', 'old' => $oldVal, 'new' => $newVal, 'diff' => '']]);
$actionID = $this->action->create('instance', $instance->id, 'adjustMemory', $newValue);
$this->action->logHistory($actionID, [['field' => 'adjustmemory', 'old' => $oldValue, 'new' => $newValue, 'diff' => '']]);
return true;
}
@@ -303,14 +303,14 @@ class instanceModel extends model
$settings->settings_map->resources = new stdclass;
$settings->settings_map->resources->cpu = $size;
$oldVal = $instance->oldVal;
$newVal = (string)$size;
unset($instance->oldVal);
$oldValue = $instance->oldValue;
$newValue = (string)$size;
unset($instance->oldValue);
$success = $this->cne->updateConfig($instance, $settings);
if($success)
{
$actionID = $this->action->create('instance', $instance->id, 'adjustCPU', $newVal);
$this->action->logHistory($actionID, [['field' => 'adjustcpu', 'old' => $oldVal, 'new' => $newVal, 'diff' => '']]);
$actionID = $this->action->create('instance', $instance->id, 'adjustCPU', $newValue);
$this->action->logHistory($actionID, [['field' => 'adjustcpu', 'old' => $oldValue, 'new' => $newValue, 'diff' => '']]);
return true;
}
@@ -345,14 +345,14 @@ class instanceModel extends model
$settings->settings = array();
$settings->settings[] = $setting;
$oldVal = $instance->oldVal;
$newVal = str_replace('Gi', '', $size);
unset($instance->oldVal);
$oldValue = $instance->oldValue;
$newValue = str_replace('Gi', '', $size);
unset($instance->oldValue);
$success = $this->cne->updateConfig($instance, $settings);
if($success)
{
$actionID = $this->action->create('instance', $instance->id, 'adjustVol', $newVal);
$this->action->logHistory($actionID, [['field' => 'adjustvol', 'old' => $oldVal, 'new' => $newVal, 'diff' => '']]);
$actionID = $this->action->create('instance', $instance->id, 'adjustVol', $newValue);
$this->action->logHistory($actionID, [['field' => 'adjustvol', 'old' => $oldValue, 'new' => $newValue, 'diff' => '']]);
return true;
}