Merge branch 'bugifx/32867' into 'master'

* modify the getImageList method in the zahost model, fix bug #32867.

See merge request easycorp/zentaopms!7205
This commit is contained in:
孙广明
2023-03-16 07:32:00 +00:00
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ class hostSubmitEntry extends baseEntry
{
if(in_array($image->status, array('failed', 'completed'))) $image->status = $image->status == 'completed' ? 'restore_completed' : 'restore_failed';
}
else if($imageInfo->from == 'snapshot' && $imageInfo->status == 'creating')
else if($imageInfo->from == 'snapshot')
{
if($image->status == 'failed')
{
+2 -2
View File
@@ -193,7 +193,7 @@ class zahostModel extends model
*/
public function getImageList($hostID, $browseType = 'all', $param = 0, $orderBy = 'id', $pager = null)
{
$imageList = json_decode(file_get_contents($this->config->zahost->imageListUrl));
$imageList = json_decode(commonModel::http($this->config->zahost->imageListUrl, array(), array()));
$downloadedImageList = $this->dao->select('*')->from(TABLE_IMAGE)
->where('host')->eq($hostID)
@@ -256,7 +256,7 @@ class zahostModel extends model
*/
public function createImage($hostID, $imageName)
{
$imageList = json_decode(file_get_contents($this->config->zahost->imageListUrl));
$imageList = json_decode(commonModel::http($this->config->zahost->imageListUrl, array(), array()));
$imageData = new stdclass;
foreach($imageList as $item) if($item->name == $imageName) $imageData = $item;