dom0-updates: convert to core3 API

This commit is contained in:
Marek Marczykowski-Górecki 2016-02-11 02:38:59 +01:00
parent 0568d2ae3b
commit b91eace873
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 6 additions and 7 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
UPDATEVM=`qubes-prefs --get updatevm` UPDATEVM=`qubes-prefs --force-root updatevm`
UPDATES_STAT_FILE=/var/lib/qubes/updates/dom0-updates-available UPDATES_STAT_FILE=/var/lib/qubes/updates/dom0-updates-available
if [ -z "$UPDATEVM" ]; then if [ -z "$UPDATEVM" ]; then

View File

@ -27,7 +27,7 @@ import subprocess
import shutil import shutil
import glob import glob
import grp import grp
from qubes.qubes import QubesVmCollection import qubes
updates_dir = "/var/lib/qubes/updates" updates_dir = "/var/lib/qubes/updates"
updates_rpm_dir = updates_dir + "/rpm" updates_rpm_dir = updates_dir + "/rpm"
@ -121,12 +121,11 @@ def handle_dom0updates(updatevm):
def main(): def main():
qvm_collection = QubesVmCollection() app = qubes.Qubes()
qvm_collection.lock_db_for_reading()
qvm_collection.load()
qvm_collection.unlock_db()
updatevm = qvm_collection.get_updatevm_vm() updatevm = app.updatevm
if updatevm is None:
exit(1)
handle_dom0updates(updatevm) handle_dom0updates(updatevm)
main() main()