cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
s999_cleanup_libvirt.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # @COPYRIGHT_begin
3 #
4 # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # @COPYRIGHT_end
19 
20 # Debian base image
21 import os
22 from settings import SERVICES_TMP, BASIC_IMAGE, SSH_KEY, SYSTEM_VERSION
23 actions = []
24 
25 # Remove machines
26 actions.append({'type': 'exec',
27  'command': 'virsh',
28  'args': ['-c', 'qemu:///system', 'destroy', 'wi']})
29 actions.append({'type': 'exec',
30  'command': 'virsh',
31  'args': ['-c', 'qemu:///system', 'destroy', 'clm']})
32 actions.append({'type': 'exec',
33  'command': 'virsh',
34  'args': ['-c', 'qemu:///system', 'destroy', 'cm']})
35 actions.append({'type': 'exec',
36  'command': 'virsh',
37  'args': ['-c', 'qemu:///system', 'destroy', 'rm']})
38 actions.append({'type': 'exec',
39  'command': 'virsh',
40  'args': ['-c', 'qemu:///system', 'destroy', 'node04']})
41 actions.append({'type': 'exec',
42  'command': 'virsh',
43  'args': ['-c', 'qemu:///system', 'destroy', 'node05']})
44 
45 # Remove old networks
46 actions.append({'type': 'exec', 'command': 'virsh', 'args': ['-c', 'qemu:///system', 'net-destroy', 'wi_clm']})
47 actions.append({'type': 'exec', 'command': 'virsh', 'args': ['-c', 'qemu:///system', 'net-destroy', 'clm_cm']})
48 actions.append({'type': 'exec', 'command': 'virsh', 'args': ['-c', 'qemu:///system', 'net-destroy', 'cm_cluster']})
49 
50 # Remove SERVICES_TMP directory
51 actions.append({'type': 'exec', 'command': 'rm', 'args': ['-rf', SERVICES_TMP]})
52