Oleksii Zhurba | 1580fc5 | 2017-11-14 15:20:44 -0600 | [diff] [blame] | 1 | #!/bin/bash |
Oleksii Zhurba | 1580fc5 | 2017-11-14 15:20:44 -0600 | [diff] [blame] | 2 | export OS_INTERFACE='admin' |
Oleksandr Savatieiev | 0a1db22 | 2019-01-29 10:31:19 +0100 | [diff] [blame] | 3 | mask='s_rally\|rally_\|tempest_\|tempest-' |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 4 | dry_run=false |
| 5 | clean_projects=false |
Oleksandr Savatieiev | 41df4eb | 2018-11-08 16:22:30 +0100 | [diff] [blame] | 6 | make_servers_active=false |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 7 | |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 8 | batch_size=10 |
Oleksandr Savatieiev | 722396b | 2019-01-29 12:53:21 +0100 | [diff] [blame] | 9 | # granularity values: days,hours,minutes,seconds |
| 10 | stack_granularity=days |
| 11 | stack_granularity_value=1 |
| 12 | |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 13 | function show_help { |
Oleksandr Savatieiev | 722396b | 2019-01-29 12:53:21 +0100 | [diff] [blame] | 14 | printf "Resource cleaning script\nMask is: %s\n\t-h, -?\tShow this help\n" ${mask} |
| 15 | printf "\t-t\tDry run mode, no cleaning done\n" |
| 16 | printf "\t-P\tForce cleaning of projects\n" |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 17 | printf "\t-s\tUse single thread of 'openstack' client for cleanup\n" |
Oleksandr Savatieiev | 722396b | 2019-01-29 12:53:21 +0100 | [diff] [blame] | 18 | printf "\t-S\tSet servers to ACTIVE before deletion (bare metal reqiured)\n" |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 19 | printf "\t-F\tForce purge deleted stacks. Batch size: %s, >%s %s\n" ${batch_size} ${stack_granularity_value} ${stack_granularity} |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | OPTIND=1 # Reset in case getopts has been used previously in the shell. |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 23 | while getopts "h?:tsSPF" opt; do |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 24 | case "$opt" in |
| 25 | h|\?) |
| 26 | show_help |
| 27 | exit 0 |
| 28 | ;; |
| 29 | t) dry_run=true |
| 30 | printf "Running in dry-run mode\n" |
| 31 | ;; |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 32 | s) serial=true |
| 33 | printf "Single threaded mode enabled\n" |
| 34 | ;; |
Oleksandr Savatieiev | 41df4eb | 2018-11-08 16:22:30 +0100 | [diff] [blame] | 35 | S) make_servers_active=true |
| 36 | printf "Servers will be set to ACTIVE before deletion\n" |
| 37 | ;; |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 38 | P) clean_projects=true |
| 39 | printf "Project cleanning enabled\n" |
| 40 | ;; |
Oleksandr Savatieiev | 722396b | 2019-01-29 12:53:21 +0100 | [diff] [blame] | 41 | F) purge_deleted_stacks=true |
| 42 | printf "Purging stacks deleted >$stack_granularity_value $stack_granularity ago enabled, batch size %s\n" $stack_batch_size |
| 43 | ;; |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 44 | esac |
| 45 | done |
| 46 | |
| 47 | shift $((OPTIND-1)) |
| 48 | [ "${1:-}" = "--" ] && shift |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 49 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 50 | ### Execute collected commands and flush the temp file |
| 51 | function _clean_and_flush { |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 52 | if [ "$dry_run" = true ] ; then |
| 53 | return 0 |
| 54 | fi |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 55 | if [ -s ${cmds} ]; then |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 56 | if [ "${serial}" = true ] ; then |
| 57 | echo "... processing $(cat ${cmds} | wc -l) commands, worker threads ${batch_size}" |
| 58 | cat ${cmds} | tr '\n' '\0' | xargs -v -P ${batch_size} -n 1 -0 openstack |
| 59 | #cat ${cmds} | openstack |
| 60 | truncate -s 0 ${cmds} |
| 61 | else |
| 62 | echo "... processing $(cat ${cmds} | wc -l) commands" |
| 63 | cat ${cmds} | openstack |
| 64 | truncate -s 0 ${cmds} |
| 65 | fi |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 66 | fi |
| 67 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 68 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 69 | ### Users |
| 70 | function _clean_users { |
| 71 | users=( $(openstack user list -c ID -c Name -f value | grep ${mask} | cut -d' ' -f1) ) |
| 72 | echo "-> ${#users[@]} users containing '${mask}' found" |
| 73 | printf "%s\n" ${users[@]} | xargs -I{} echo user delete {} >>${cmds} |
| 74 | _clean_and_flush |
| 75 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 76 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 77 | ### Roles |
| 78 | function _clean_roles { |
| 79 | roles=( $(openstack role list -c ID -c Name -f value | grep ${mask} | cut -d' ' -f1) ) |
| 80 | echo "-> ${#roles[@]} roles containing '${mask}' found" |
| 81 | printf "%s\n" ${roles[@]} | xargs -I{} echo role delete {} >>${cmds} |
| 82 | _clean_and_flush |
| 83 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 84 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 85 | ### Projects |
| 86 | function _clean_projects { |
| 87 | projects=( $(openstack project list -c ID -c Name -f value | grep ${mask} | cut -d' ' -f1) ) |
| 88 | echo "-> ${#projects[@]} projects containing '${mask}' found" |
| 89 | printf "%s\n" ${projects[@]} | xargs -I{} echo project delete {} >>${cmds} |
| 90 | _clean_and_flush |
| 91 | } |
Valentyn Khalin | bdf3ba9 | 2018-07-13 18:14:20 +0300 | [diff] [blame] | 92 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 93 | ### Servers |
| 94 | function _clean_servers { |
Oleksandr Savatieiev | 0a1db22 | 2019-01-29 10:31:19 +0100 | [diff] [blame] | 95 | servers=( $(openstack server list -c ID -c Name -f value --all | grep "${mask}" | cut -d' ' -f1) ) |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 96 | echo "-> ${#servers[@]} servers containing '${mask}' found" |
Oleksandr Savatieiev | 41df4eb | 2018-11-08 16:22:30 +0100 | [diff] [blame] | 97 | if [ "$make_servers_active" = true ]; then |
| 98 | printf "%s\n" ${servers[@]} | xargs -I{} echo server set --state active {} >>${cmds} |
| 99 | fi |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 100 | printf "%s\n" ${servers[@]} | xargs -I{} echo server delete {} >>${cmds} |
| 101 | _clean_and_flush |
| 102 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 103 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 104 | ### Reset snapshot state and delete |
| 105 | function _clean_snapshots { |
| 106 | snapshots=( $(openstack volume snapshot list --all -c ID -c Name -f value | grep ${mask} | cut -d' ' -f1) ) |
| 107 | echo "-> ${#snapshots[@]} snapshots containing '${mask}' found" |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 108 | printf "%s\n" ${snapshots[@]} | xargs -I{} echo volume snapshot set --state available {} >>${cmds} |
| 109 | printf "%s\n" ${snapshots[@]} | xargs -I{} echo volume snapshot delete {} >>${cmds} |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 110 | _clean_and_flush |
| 111 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 112 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 113 | function _clean_volumes { |
| 114 | volumes=( $(openstack volume list --all -c ID -c Name -c Type -f value | grep ${mask} | cut -d' ' -f1) ) |
| 115 | echo "-> ${#volumes[@]} volumes containing '${mask}' found" |
| 116 | printf "%s\n" ${volumes[@]} | xargs -I{} echo volume set --state available {} >>${cmds} |
| 117 | printf "%s\n" ${volumes[@]} | xargs -I{} echo volume delete {} >>${cmds} |
| 118 | _clean_and_flush |
| 119 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 120 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 121 | ### Volume types |
| 122 | function _clean_volume_types { |
| 123 | vtypes=( $(openstack volume type list -c ID -c Name -f value | grep ${mask} | cut -d' ' -f1) ) |
| 124 | echo "-> ${#vtypes[@]} volume types containing '${mask}' found" |
| 125 | printf "%s\n" ${vtypes[@]} | xargs -I{} echo volume type delete {} >>${cmds} |
| 126 | _clean_and_flush |
| 127 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 128 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 129 | ### Images |
| 130 | function _clean_images { |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 131 | images=( $(openstack image list -c ID -c Name -f value | grep ${mask} | cut -d' ' -f1) ) |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 132 | echo "-> ${#images[@]} images containing '${mask}' found" |
| 133 | printf "%s\n" ${images[@]} | xargs -I{} echo image delete {} >>${cmds} |
| 134 | _clean_and_flush |
| 135 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 136 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 137 | ### Sec groups |
| 138 | function _clean_sec_groups { |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 139 | projects=( $(openstack project list -c ID -c Name -f value | grep ${mask} | cut -d' ' -f1) ) |
| 140 | sgroups=( $(printf "%s\n" ${projects[@]} | xargs -I{} /bin/bash -c "openstack security group list -c ID -c Project -f value | grep {} | cut -d' ' -f1") ) |
| 141 | echo "-> ${#sgroups[@]} security groups for project containing '${mask}' found" |
| 142 | printf "%s\n" ${sgroups[@]} | xargs -I{} echo security group delete {} >>${cmds} |
| 143 | _clean_and_flush |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 144 | |
| 145 | # Additional step to cleanup 'hanged' groups |
| 146 | sgroups_raw=( $(openstack security group list -c ID -c Name -f value | grep ${mask} | cut -d' ' -f1) ) |
| 147 | echo "-> ${#sgroups_raw[@]} security groups for '${mask}' found" |
| 148 | printf "%s\n" ${sgroups_raw[@]} | xargs -I{} echo security group delete {} >>${cmds} |
| 149 | _clean_and_flush |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 150 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 151 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 152 | ### Keypairs |
| 153 | function _clean_keypairs { |
| 154 | keypairs=( $(openstack keypair list -c Name -f value | grep ${mask}) ) |
| 155 | echo "-> ${#keypairs[@]} keypairs containing '${mask}' found" |
| 156 | printf "%s\n" ${keypairs[@]} | xargs -I{} echo keypair delete {} >>${cmds} |
| 157 | _clean_and_flush |
| 158 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 159 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 160 | ### Routers and Networks |
| 161 | function _clean_routers_and_networks { |
| 162 | routers=( $(openstack router list -c ID -c Name -f value | grep ${mask} | cut -d ' ' -f1) ) |
| 163 | if [ ${#routers[@]} -eq 0 ]; then |
| 164 | echo "-> No routers containing '${mask}' found" |
| 165 | else |
| 166 | echo "-> ${#routers[@]} routers containing '${mask}' found" |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 167 | echo "... unsetting gateways" |
| 168 | printf "%s\n" ${routers[@]} | xargs -I{} echo router unset --external-gateway {} >>${cmds} |
| 169 | _clean_and_flush |
| 170 | |
| 171 | echo "... removing ports" |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 172 | for router in ${routers[@]}; do |
| 173 | r_ports=( $(openstack port list --router ${router} -f value -c ID) ) |
| 174 | if [ ${#r_ports[@]} -eq 0 ]; then |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 175 | echo "... no ports to unplug for ${router}" |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 176 | else |
| 177 | for r_port in ${r_ports[@]}; do |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 178 | echo "... queued removal of port '${r_port}' from router '${router}'" |
| 179 | echo "router remove port ${router} ${r_port}" >>${cmds} |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 180 | done |
| 181 | fi |
| 182 | done |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 183 | _clean_and_flush |
| 184 | |
| 185 | echo "... deleting routers" |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 186 | printf "%s\n" ${routers[@]} | xargs -I{} echo router delete {} >>${cmds} |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 187 | _clean_and_flush |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 188 | fi |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 189 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 190 | networks=( $(openstack network list | grep "${mask}" | cut -d' ' -f2) ) |
| 191 | if [ ${#networks[@]} -eq 0 ]; then |
| 192 | echo "-> No networks containing '${mask}' found" |
| 193 | else |
| 194 | ports=() |
| 195 | subnets=() |
| 196 | for((idx=0;idx<${#networks[@]};idx++)) do |
| 197 | ports+=( $(openstack port list --network ${networks[idx]} -c ID -f value) ) |
| 198 | subnets+=( $(openstack subnet list --network ${networks[idx]} -c ID -f value) ) |
| 199 | echo "-> $((${idx}+1)) of ${#networks[@]}, total ${#ports[@]} ports, ${#subnets[@]} subnets" |
| 200 | done |
| 201 | printf "%s\n" ${ports[@]} | xargs -I{} echo port delete {} >>${cmds} |
| 202 | printf "%s\n" ${subnets[@]} | xargs -I{} echo subnet delete {} >>${cmds} |
| 203 | echo network delete ${networks[@]} >>${cmds} |
| 204 | echo "-> ${#routers[@]} routers, ${#ports[@]} ports, ${#subnets[@]} subnets, ${#networks[@]} networks" |
| 205 | fi |
| 206 | _clean_and_flush |
| 207 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 208 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 209 | ### Regions |
| 210 | function _clean_regions { |
| 211 | regions=( $(openstack region list -c Region -f value | grep ${mask}) ) |
| 212 | echo "-> ${#regions[@]} regions containing '${mask}' found" |
| 213 | printf "%s\n" ${regions[@]} | xargs -I{} echo region delete {} >>${cmds} |
| 214 | _clean_and_flush |
| 215 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 216 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 217 | ### Stacks |
| 218 | function _clean_stacks { |
| 219 | # By default openstack denies use of global_index for everyone. |
| 220 | # In case you want to have handy cleanup, consider updating policy.json here: |
| 221 | # root@ctl0x:~# cat -n /etc/heat/policy.json | grep global_index |
| 222 | # 48 "stacks:global_index": "rule:deny_everybody", |
| 223 | # 73 "software_configs:global_index": "rule:deny_everybody", |
| 224 | # After this you will be able to use --all option |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 225 | |
Oleksandr Savatieiev | 722396b | 2019-01-29 12:53:21 +0100 | [diff] [blame] | 226 | stacks=( $(openstack stack list --nested --hidden -c ID -c "Stack Name" -f value | grep ${mask} | cut -d' ' -f1) ) |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 227 | echo "-> ${#stacks[@]} stacks containing '${mask}' found" |
| 228 | printf "%s\n" ${stacks[@]} | xargs -I{} echo stack check {} >>${cmds} |
| 229 | printf "%s\n" ${stacks[@]} | xargs -I{} echo stack delete -y {} >>${cmds} |
| 230 | _clean_and_flush |
Oleksandr Savatieiev | 722396b | 2019-01-29 12:53:21 +0100 | [diff] [blame] | 231 | if [ "$purge_deleted_stacks" = true ]; then |
Alex Savatieiev | 788193b | 2019-03-12 11:39:08 -0500 | [diff] [blame] | 232 | heat-manage purge_deleted -g ${stack_granularity} -b ${batch_size} ${stack_granularity_value} | wc -l | xargs -I{} echo "-> Purged {} stacks" |
Oleksandr Savatieiev | 722396b | 2019-01-29 12:53:21 +0100 | [diff] [blame] | 233 | fi |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 234 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 235 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 236 | ### Containers |
| 237 | function _clean_containers { |
| 238 | containers=( $(openstack container list --all -c ID -c Name -f value | grep ${mask}) ) |
| 239 | echo "-> ${#containers[@]} containers containing '${mask}' found" |
| 240 | printf "%s\n" ${containers[@]} | xargs -I{} echo container delete {} >>${cmds} |
| 241 | _clean_and_flush |
| 242 | } |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 243 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 244 | ################### |
| 245 | ### Main |
| 246 | ################### |
| 247 | # temp file for commands |
| 248 | cmds=$(mktemp) |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 249 | trap "rm -f ${cmds}" EXIT |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 250 | echo "Using tempfile: '${cmds}'" |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 251 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 252 | # Consider cleaning contrail resources carefully |
| 253 | # ...and only after that - clean projects |
Oleksii Zhurba | 0aa4670 | 2018-02-07 16:17:39 -0600 | [diff] [blame] | 254 | |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 255 | _clean_stacks |
| 256 | _clean_servers |
| 257 | |
| 258 | _clean_users |
| 259 | _clean_roles |
| 260 | _clean_snapshots |
| 261 | _clean_volumes |
| 262 | _clean_volume_types |
| 263 | _clean_images |
| 264 | _clean_sec_groups |
| 265 | _clean_keypairs |
| 266 | _clean_routers_and_networks |
| 267 | _clean_regions |
| 268 | _clean_containers |
| 269 | |
| 270 | # project cleaning disabled by default |
| 271 | # Coz cleaning Contrail with no projects is a hard task |
Oleksandr Savatieiev | c1bbead | 2018-10-18 14:39:25 +0200 | [diff] [blame] | 272 | if [ "$clean_projects" = true ]; then |
| 273 | _clean_projects |
| 274 | fi |
Oleksandr Savatieiev | 91355c8 | 2018-09-07 12:14:34 +0200 | [diff] [blame] | 275 | |
| 276 | # remove temp file |
| 277 | rm ${cmds} |