"created": created,
"created_items": created_items,
"vim_details": None,
+ "vim_message": None,
}
self.logger.debug(
"task={} {} new-net={} created={}".format(
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
"created": created,
- "vim_details": str(e),
+ "vim_message": str(e),
}
return "FAILED", ro_vim_item_update
ro_vim_item_update["vim_name"] = vim_info.get("name")
if vim_info["status"] in ("ERROR", "VIM_ERROR"):
- if ro_task["vim_info"]["vim_details"] != vim_info.get("error_msg"):
- ro_vim_item_update["vim_details"] = vim_info.get("error_msg")
+ if ro_task["vim_info"]["vim_message"] != vim_info.get("error_msg"):
+ ro_vim_item_update["vim_message"] = vim_info.get("error_msg")
elif vim_info["status"] == "DELETED":
ro_vim_item_update["vim_id"] = None
- ro_vim_item_update["vim_details"] = "Deleted externally"
+ ro_vim_item_update["vim_message"] = "Deleted externally"
else:
if ro_task["vim_info"]["vim_details"] != vim_info["vim_info"]:
ro_vim_item_update["vim_details"] = vim_info["vim_info"]
ro_task["target_id"],
vim_id,
ro_vim_item_update.get("vim_status"),
- ro_vim_item_update.get("vim_details")
+ ro_vim_item_update.get("vim_message")
if ro_vim_item_update.get("vim_status") != "ACTIVE"
else "",
)
ro_vim_item_update_ok = {
"vim_status": "DELETED",
"created": False,
- "vim_details": "DELETED",
+ "vim_message": "DELETED",
"vim_id": None,
}
net_vim_id, ro_task["vim_info"]["created_items"]
)
except vimconn.VimConnNotFoundException:
- ro_vim_item_update_ok["vim_details"] = "already deleted"
+ ro_vim_item_update_ok["vim_message"] = "already deleted"
except vimconn.VimConnException as e:
self.logger.error(
"ro_task={} vim={} del-net={}: {}".format(
)
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
- "vim_details": "Error while deleting: {}".format(e),
+ "vim_message": "Error while deleting: {}".format(e),
}
return "FAILED", ro_vim_item_update
task_id,
ro_task["target_id"],
net_vim_id,
- ro_vim_item_update_ok.get("vim_details", ""),
+ ro_vim_item_update_ok.get("vim_message", ""),
)
)
"created": created,
"created_items": created_items,
"vim_details": None,
+ "vim_message": None,
"interfaces_vim_ids": interfaces,
"interfaces": [],
}
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
"created": created,
- "vim_details": str(e),
+ "vim_message": str(e),
}
return "FAILED", ro_vim_item_update
ro_vim_item_update_ok = {
"vim_status": "DELETED",
"created": False,
- "vim_details": "DELETED",
+ "vim_message": "DELETED",
"vim_id": None,
}
ro_task["vim_info"].get("volumes_to_hold", []),
)
except vimconn.VimConnNotFoundException:
- ro_vim_item_update_ok["vim_details"] = "already deleted"
+ ro_vim_item_update_ok["vim_message"] = "already deleted"
except vimconn.VimConnException as e:
self.logger.error(
"ro_task={} vim={} del-vm={}: {}".format(
)
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
- "vim_details": "Error while deleting: {}".format(e),
+ "vim_message": "Error while deleting: {}".format(e),
}
return "FAILED", ro_vim_item_update
task_id,
ro_task["target_id"],
vm_vim_id,
- ro_vim_item_update_ok.get("vim_details", ""),
+ ro_vim_item_update_ok.get("vim_message", ""),
)
)
ro_vim_item_update["vim_name"] = vim_info.get("name")
if vim_info["status"] in ("ERROR", "VIM_ERROR"):
- if ro_task["vim_info"]["vim_details"] != vim_info.get("error_msg"):
- ro_vim_item_update["vim_details"] = vim_info.get("error_msg")
+ if ro_task["vim_info"]["vim_message"] != vim_info.get("error_msg"):
+ ro_vim_item_update["vim_message"] = vim_info.get("error_msg")
elif vim_info["status"] == "DELETED":
ro_vim_item_update["vim_id"] = None
- ro_vim_item_update["vim_details"] = "Deleted externally"
+ ro_vim_item_update["vim_message"] = "Deleted externally"
else:
if ro_task["vim_info"]["vim_details"] != vim_info["vim_info"]:
ro_vim_item_update["vim_details"] = vim_info["vim_info"]
ro_task["target_id"],
vim_id,
ro_vim_item_update.get("vim_status"),
- ro_vim_item_update.get("vim_details")
+ ro_vim_item_update.get("vim_message")
if ro_vim_item_update.get("vim_status") != "ACTIVE"
else "",
)
self.logger.error(
"task={} {} inject-ssh-key: {}".format(task_id, ro_task["target_id"], e)
)
- ro_vim_item_update = {"vim_details": str(e)}
+ ro_vim_item_update = {"vim_message": str(e)}
return "FAILED", ro_vim_item_update, db_task_update
"created": created,
"created_items": created_items,
"vim_details": None,
+ "vim_message": None,
}
self.logger.debug(
"task={} {} new-image={} created={}".format(
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
"created": created,
- "vim_details": str(e),
+ "vim_message": str(e),
}
return "FAILED", ro_vim_item_update
ro_vim_item_update_ok = {
"vim_status": "DELETED",
"created": False,
- "vim_details": "DELETED",
+ "vim_message": "DELETED",
"vim_id": None,
}
target_vim = self.my_vims[ro_task["target_id"]]
target_vim.delete_flavor(flavor_vim_id)
except vimconn.VimConnNotFoundException:
- ro_vim_item_update_ok["vim_details"] = "already deleted"
+ ro_vim_item_update_ok["vim_message"] = "already deleted"
except vimconn.VimConnException as e:
self.logger.error(
"ro_task={} vim={} del-flavor={}: {}".format(
)
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
- "vim_details": "Error while deleting: {}".format(e),
+ "vim_message": "Error while deleting: {}".format(e),
}
return "FAILED", ro_vim_item_update
task_id,
ro_task["target_id"],
flavor_vim_id,
- ro_vim_item_update_ok.get("vim_details", ""),
+ ro_vim_item_update_ok.get("vim_message", ""),
)
)
"created": created,
"created_items": created_items,
"vim_details": None,
+ "vim_message": None,
}
self.logger.debug(
"task={} {} new-flavor={} created={}".format(
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
"created": created,
- "vim_details": str(e),
+ "vim_message": str(e),
}
return "FAILED", ro_vim_item_update
ro_vim_item_update_ok = {
"vim_status": "DELETED",
"created": False,
- "vim_details": "DELETED",
+ "vim_message": "DELETED",
"vim_id": None,
}
target_vim = self.my_vims[ro_task["target_id"]]
target_vim.delete_affinity_group(affinity_group_vim_id)
except vimconn.VimConnNotFoundException:
- ro_vim_item_update_ok["vim_details"] = "already deleted"
+ ro_vim_item_update_ok["vim_message"] = "already deleted"
except vimconn.VimConnException as e:
self.logger.error(
"ro_task={} vim={} del-affinity-or-anti-affinity-group={}: {}".format(
)
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
- "vim_details": "Error while deleting: {}".format(e),
+ "vim_message": "Error while deleting: {}".format(e),
}
return "FAILED", ro_vim_item_update
task_id,
ro_task["target_id"],
affinity_group_vim_id,
- ro_vim_item_update_ok.get("vim_details", ""),
+ ro_vim_item_update_ok.get("vim_message", ""),
)
)
"created": created,
"created_items": created_items,
"vim_details": None,
+ "vim_message": None,
}
self.logger.debug(
"task={} {} new-affinity-or-anti-affinity-group={} created={}".format(
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
"created": created,
- "vim_details": str(e),
+ "vim_message": str(e),
}
return "FAILED", ro_vim_item_update
"created_items": created_items,
"connected_ports": connected_ports,
"vim_details": sdn_info,
+ "vim_message": None,
"last_update": last_update,
}
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
"created": created,
- "vim_details": str(e),
+ "vim_message": str(e),
}
return "FAILED", ro_vim_item_update
ro_vim_item_update_ok = {
"vim_status": "DELETED",
"created": False,
- "vim_details": "DELETED",
+ "vim_message": "DELETED",
"vim_id": None,
}
isinstance(e, sdnconn.SdnConnectorError)
and e.http_code == HTTPStatus.NOT_FOUND.value
):
- ro_vim_item_update_ok["vim_details"] = "already deleted"
+ ro_vim_item_update_ok["vim_message"] = "already deleted"
else:
self.logger.error(
"ro_task={} vim={} del-sdn-net={}: {}".format(
)
ro_vim_item_update = {
"vim_status": "VIM_ERROR",
- "vim_details": "Error while deleting: {}".format(e),
+ "vim_message": "Error while deleting: {}".format(e),
}
return "FAILED", ro_vim_item_update
task_id,
ro_task["target_id"],
sdn_vim_id,
- ro_vim_item_update_ok.get("vim_details", ""),
+ ro_vim_item_update_ok.get("vim_message", ""),
)
)
1642158640.7986135;1642158640.7986135;1642158640.7986135;b134c9494e75:0a
;vim:b7ff9e24-8868-4d68-8a57-a59dc11d0327;None;{'created': False,
'created_items': None, 'vim_id': None, 'vim_name': None, 'vim_status': None,
- 'vim_details': None, 'refresh_at': None};1;SCHEDULED;
+ 'vim_details': None, 'vim_message': None, 'refresh_at': None};1;SCHEDULED;
888f1864-749a-4fc2-bc1a-97c0fffd6a6f;0;888f1864-749a-4fc2-bc1a-97c0fffd6a6f:2;
CREATE;image;{'filter_dict': {'name': 'ubuntu-os-cloud:image-family:ubuntu-1804-lts'}}
"""
exc_info=True,
)
- return "FAILED", {"vim_status": "VIM_ERROR", "vim_details": str(e)}
+ return "FAILED", {"vim_status": "VIM_ERROR", "vim_message": str(e)}
def _create_task(self, ro_task, task_index, task_depends, db_update):
"""
)
task_status = "FAILED"
- ro_vim_item_update = {"vim_status": "VIM_ERROR", "vim_details": str(e)}
+ ro_vim_item_update = {"vim_status": "VIM_ERROR", "vim_message": str(e)}
# TODO update ro_vim_item_update
return task_status, ro_vim_item_update
dependency_task["item"],
dependency_task_id,
dependency_ro_task["vim_info"].get(
- "vim_details"
+ "vim_message"
),
)
self.logger.error(
new_status = "FAILED"
db_vim_info_update = {
"vim_status": "VIM_ERROR",
- "vim_details": str(e),
+ "vim_message": str(e),
}
if not isinstance(
path_vim_status + "." + k: v
for k, v in ro_vim_item_update.items()
if k
- in ("vim_id", "vim_details", "vim_name", "vim_status", "interfaces")
+ in (
+ "vim_id",
+ "vim_details",
+ "vim_message",
+ "vim_name",
+ "vim_status",
+ "interfaces",
+ )
}
if path_vim_status.startswith("vdur."):
"vim_name": "test-vim",
"vim_status": None,
"vim_details": "some-details",
+ "vim_message": None,
"refresh_at": None,
},
"modified_at": 1637324200.994312,
"vim_name": "test-vim",
"vim_status": "BUILD",
"vim_details": "",
+ "vim_message": None,
"refresh_at": None,
},
"modified_at": 1637324200.994312,
"vim_name": "test-vim",
"vim_status": "BUILD",
"vim_details": "",
+ "vim_message": None,
"refresh_at": None,
},
"modified_at": 1637324200.994312,
task_status = "FAILED"
ro_vim_item_update = {
"vim_status": "ERROR",
- "vim_details": "some error message",
+ "vim_message": "some error message",
}
result = instance.refresh(ro_task)
self.assertEqual(result[0], task_status)
"vim_name": "test-vim",
"vim_status": "BUILD",
"vim_details": "",
+ "vim_message": None,
"refresh_at": None,
},
"modified_at": 1637324200.994312,
"vim_name": "test-vim",
"vim_status": "BUILD",
"vim_details": "",
+ "vim_message": None,
"refresh_at": None,
},
"modified_at": 163724200.994312,
task_status = "FAILED"
ro_vim_item_update = {
"vim_status": "DELETED",
- "vim_details": "Deleted externally",
+ "vim_message": "Deleted externally",
"vim_id": None,
}
result = instance.refresh(ro_task)
"vim_name": "test-vim",
"vim_status": "BUILD",
"vim_details": "",
+ "vim_message": None,
"refresh_at": None,
},
"modified_at": 163724211.994312,
"vim_name": "sample_affinity_group_id_3",
"vim_status": None,
"vim_details": "some-details",
+ "vim_message": None,
"refresh_at": None,
},
}
)
result = instance.delete(ro_task, task_index)
self.assertEqual(result[0], "DONE")
- self.assertEqual(result[1].get("vim_details"), "DELETED")
+ self.assertEqual(result[1].get("vim_message"), "DELETED")
self.assertEqual(result[1].get("created"), False)
self.assertEqual(result[1].get("vim_status"), "DELETED")
"vim_name": None,
"vim_status": None,
"vim_details": "some-details",
+ "vim_message": None,
"refresh_at": None,
},
}
self.target_vim.delete_affinity_group.return_value = ""
result = instance.delete(ro_task, task_index)
self.assertEqual(result[0], "DONE")
- self.assertEqual(result[1].get("vim_details"), "DELETED")
+ self.assertEqual(result[1].get("vim_message"), "DELETED")
self.assertEqual(result[1].get("created"), False)
self.assertEqual(result[1].get("vim_status"), "DELETED")