b0f773086c
+ Install xen tools dpkg on compute nodes + Install nova/xapi plugin on compute nodes + Install xenapi sdk on compute nodes + Setup HIMN between compute nodes and xenservers + Initialize nova-compute.conf + Remove existed images from glance and create new
21 lines
482 B
Python
Executable File
21 lines
482 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import os
|
|
import yaml
|
|
|
|
settings = yaml.load(open('/etc/nailgun/settings.yaml'))
|
|
db_settings = settings['DATABASE']
|
|
os.environ["PGPASSWORD"] = db_settings['passwd']
|
|
|
|
def execute_sql(sql):
|
|
paras = dict(db_settings.items() + {'sql':sql}.items())
|
|
cmd = ('psql -h {host} -p {port} -U {user} -w -d {name} '
|
|
'-c "{sql}" '
|
|
).format(**paras)
|
|
print cmd
|
|
os.system(cmd)
|
|
|
|
if __name__ == '__main__':
|
|
execute_sql('delete from releases where name like \'%Xen%\';')
|
|
|