Commit 97a00437 authored by Daniele Venzano's avatar Daniele Venzano

Fix the 'essentials already started' bug

A service in the undefined state is dead, since it does not exist in the container list generated by the backend.
Add also a column indicating if a service is essential or not in the command line client, to aid debugging.
parent 49e0227c
......@@ -189,9 +189,9 @@ def exec_get_cmd(auth, args):
tabular_data = []
for c_id in execution['services']:
service = cont_api.get(c_id)
service_data = [service['id'], service['name'], service['status'], service['backend_status'], service['error_message'] if service['error_message'] is not None else '']
service_data = [service['id'], service['name'], 'true' if service['essential'] else 'false', service['status'], service['backend_status'], service['error_message'] if service['error_message'] is not None else '']
tabular_data.append(service_data)
headers = ['ID', 'Name', 'Zoe status', 'Backend status', 'Error message']
headers = ['ID', 'Name', 'Essential', 'Zoe status', 'Backend status', 'Error message']
print(tabulate(tabular_data, headers))
......
......@@ -234,7 +234,7 @@ class Service:
def is_dead(self):
"""Returns True if this service is not running."""
return self.backend_status == self.BACKEND_DESTROY_STATUS or self.backend_status == self.BACKEND_OOM_STATUS or self.backend_status == self.BACKEND_DIE_STATUS
return self.backend_status == self.BACKEND_DESTROY_STATUS or self.backend_status == self.BACKEND_OOM_STATUS or self.backend_status == self.BACKEND_DIE_STATUS or self.backend_status == self.BACKEND_UNDEFINED_STATUS
@property
def unique_name(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment