extend tools/cleanup-containers to support regex of container to remove

Bug #1522168 reported by sean mooney on 2015-12-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Wishlist
sean mooney

Bug Description

when developing with kolla it is sometime useful to cleanup a set of related containers.

currently the tools/cleanup-containers script removes all deployed kolla containers.
this rfe bug request proposes extending the script to take a grep extended regex as an option first argument

for example running
tools/cleanup-containers "neutron|openvswitch"

would cleanup only the container containing neutron or openvswitch in their name.

running tools/cleanup-containers with no arguments would revert to the current behavior of cleaning up
all containers.

Tags: rfe Edit Tag help
Changed in kolla:
assignee: nobody → sean mooney (sean-k-mooney)

Fix proposed to branch: master
Review: https://review.openstack.org/252667

Changed in kolla:
status: New → In Progress
sean mooney (sean-k-mooney) wrote :

this is just a nice to have but it will stop me typeing
for ct in $(docker ps | grep -E "neutron|openvswitch" | awk '{print $1}'); do docker stop $ct; docker rm $ct; done
every time i want to cleanup a set of related containers.

Changed in kolla:
importance: Undecided → Wishlist

Reviewed: https://review.openstack.org/252667
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=2ffb35ee5308ece3717263d38163e5fd9b29a3ae
Submitter: Jenkins
Branch: master

commit 2ffb35ee5308ece3717263d38163e5fd9b29a3ae
Author: Sean Mooney <email address hidden>
Date: Wed Dec 2 22:54:52 2015 +0000

    adds tools/cleanup-containers regex support

    - this change extends the tools/cleanup-containers script to
      support a grep extended regex as a first paramater.
    - if tools/cleanup-containers is called with a grep extended
      regex string as a first paramater, only containers mataching
      that regex will be cleaned up.
    - e.g. tools/cleanup-containers "neutron|openvswitch"
      will cleanup all container whoes name contains either neutron
      or openvswitch.

    Change-Id: Iadb68c0a8de40e9ec2c0a27568e3a372ec0e8303
    Closes-Bug: #1522168

Changed in kolla:
status: In Progress → Fix Committed
Steven Dake (sdake) on 2016-02-18
Changed in kolla:
milestone: none → mitaka-3
Steven Dake (sdake) on 2016-03-05
Changed in kolla:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers