added logging and try/except wrapper to api_actions.start()
@@ -275,7 +275,9 @@ class Action:
are given, start all installed tools on the master branch at verison
HEAD that are enabled
"""
+ self.logger.info("Starting: start")
status = (True, None)
+ try:
# check start priorities (priority of groups is alphabetical for now)
group_orders = {}
groups = []
@@ -294,6 +296,10 @@ class Action:
group_orders[container_groups[i]].append((int(priority), container))
containers_remaining.remove(container)
+ self.logger.info(group_orders)
+ self.logger.info(groups)
+ self.logger.info(containers_remaining)
+
# start containers based on priorities
groups = sorted(set(groups))
started_containers = []
@@ -308,10 +314,16 @@ class Action:
container.start()
self.logger.info("started "+str(container_tuple[1])+" with ID: "+str(container.short_id))
except Exception as err: # pragma: no cover
+ self.logger.warn(str(err))
container_id = self.d_client.containers.run(detach=True, **tool_dict[container_tuple[1]])
self.logger.info("started "+str(container_tuple[1])+" with ID: "+str(container_id))
except Exception as e: # pragma: no cover
- self.logger.warning("failed to start "+str(container_tuple[1])+" because: "+str(e))
+ self.logger.error("failed to start "+str(container_tuple[1])+" because: "+str(e))
+
+ self.logger.info(group_orders)
+ self.logger.info(groups)
+ self.logger.info(containers_remaining)
+ self.logger.info(started_containers)
# start the rest of the containers that didn't have any priorities set
for container in containers_remaining:
@@ -321,11 +333,22 @@ class Action:
c.start()
self.logger.info("started "+str(container)+" with ID: "+str(c.short_id))
except Exception as err: # pragma: no cover
+ self.logger.warn(str(err))
container_id = self.d_client.containers.run(detach=True, **tool_dict[container])
self.logger.info("started "+str(container)+" with ID: "+str(container_id))
except Exception as e: # pragma: no cover
- self.logger.warning("failed to start "+str(container)+" because: "+str(e))
+ self.logger.error("failed to start "+str(container)+" because: "+str(e))
+
+ self.logger.info(group_orders)
+ self.logger.info(groups)
+ self.logger.info(containers_remaining)
+ self.logger.info(started_containers)
+ except Exception as e:
+ self.logger.error(str(e))
+ status = (False, e)
+ self.logger.info(status)
+ self.logger.info("Finished: start")
return status
def update(self,
