diff --git a/kolla_mesos/cleanup.py b/kolla_mesos/cleanup.py index c328f337..a27ec57c 100644 --- a/kolla_mesos/cleanup.py +++ b/kolla_mesos/cleanup.py @@ -22,4 +22,5 @@ def cleanup(): with zk_utils.connection() as zk: zk_utils.clean(zk) marathon_client.remove_all_apps() + marathon_client.remove_all_groups() chronos_client.remove_all_jobs() diff --git a/kolla_mesos/marathon.py b/kolla_mesos/marathon.py index 72e079b8..237aa841 100644 --- a/kolla_mesos/marathon.py +++ b/kolla_mesos/marathon.py @@ -60,3 +60,8 @@ class Client(marathon.Client): apps_ids = six.moves.map(operator.itemgetter('id'), self.get_apps()) for app_id in apps_ids: self.remove_app(app_id, force=True) + + def remove_all_groups(self): + group_ids = six.moves.map(operator.itemgetter('id'), self.get_groups()) + for group_id in group_ids: + self.remove_group(group_id, force=True)