Problem description: If the overcloud plan creation fails (e.g. due to a missing capabilities-map.yaml file), the associated swift container gets created anyway. If you then try to re-create the failed plan (with the same name), the creation will now fail because the swift container name already exist.
Expected result: The code should take care of cleaning up the swift container, in case one of the steps following the container creations fails.
Steps to reproduce:
[stack@instack ~]$ mkdir haha
[stack@instack ~]$ echo "haha" > haha/haha.txt
[stack@instack ~]$ openstack overcloud plan create haha --templates haha/
Creating Swift container to store the plan
Creating plan from template files in: haha/
Started Mistral Workflow tripleo.plan_management.v1.create_deployment_plan. Execution ID: edbcaefb-6d57-4bb3-a551-0a8aee7b8a92
Exception creating plan: File missing from container: Object GET failed: http://192.168.24.1:8080/v1/AUTH_3705f89aee8a424d891dcd702e31169d/haha/capabilities-map.yaml 404 Not Found [first 60 chars of response] <html><h1>Not Found</h1><p>The resource could not be found.<
[stack@instack ~]$ swift list
haha
overcloud
[stack@instack ~]$
Workaround: Manually delete the swift container after the failed plan creation:
[stack@instack ~]$ swift delete haha
Fix proposed to branch: master /review. openstack. org/409350
Review: https:/