Add reset_vm_configs.py script
This commit is contained in:
parent
2244ea95bf
commit
90e3f4ffd8
24
dom0/aux-tools/reset_vm_configs.py
Executable file
24
dom0/aux-tools/reset_vm_configs.py
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python2.6
|
||||
from qubes.qubes import QubesVmCollection
|
||||
import sys
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
print 'Usage: fixconf templatename'
|
||||
sys.exit(1)
|
||||
qvm_collection = QubesVmCollection()
|
||||
qvm_collection.lock_db_for_reading()
|
||||
qvm_collection.load()
|
||||
qvm_collection.unlock_db()
|
||||
templ = sys.argv[1]
|
||||
tvm = qvm_collection.get_vm_by_name(templ)
|
||||
if tvm is None:
|
||||
print 'Template', templ, 'does not exist'
|
||||
sys.exit(1)
|
||||
if not tvm.is_templete():
|
||||
print templ, 'is not a template'
|
||||
sys.exit(1)
|
||||
for vm in qvm_collection.values():
|
||||
if vm.is_appvm() and vm.template_vm.qid == tvm.qid:
|
||||
vm.create_config_file()
|
||||
|
||||
main()
|
@ -81,6 +81,7 @@ cp aux-tools/convert_apptemplate2vm.sh $RPM_BUILD_ROOT/usr/lib/qubes
|
||||
cp aux-tools/convert_dirtemplate2vm.sh $RPM_BUILD_ROOT/usr/lib/qubes
|
||||
cp aux-tools/create_apps_for_appvm.sh $RPM_BUILD_ROOT/usr/lib/qubes
|
||||
cp aux-tools/remove_appvm_appmenus.sh $RPM_BUILD_ROOT/usr/lib/qubes
|
||||
cp aux-tools/reset_vm_configs.py $RPM_BUILD_ROOT/usr/lib/qubes
|
||||
cp pendrive_swapper/qubes_pencmd $RPM_BUILD_ROOT/usr/lib/qubes
|
||||
cp qmemman/server.py $RPM_BUILD_ROOT/usr/lib/qubes/qmemman_daemon.py
|
||||
cp ../common/meminfo-writer $RPM_BUILD_ROOT/usr/lib/qubes/
|
||||
@ -216,6 +217,7 @@ fi
|
||||
/usr/lib/qubes/convert_dirtemplate2vm.sh
|
||||
/usr/lib/qubes/create_apps_for_appvm.sh
|
||||
/usr/lib/qubes/remove_appvm_appmenus.sh
|
||||
/usr/lib/qubes/reset_vm_configs.py
|
||||
/usr/lib/qubes/qubes_pencmd
|
||||
/usr/lib/qubes/qmemman_daemon.py*
|
||||
/usr/lib/qubes/meminfo-writer
|
||||
|
Loading…
Reference in New Issue
Block a user