dispvm: remove unused imports, mark methods as static where appropriate
This commit is contained in:
parent
3ca94941b1
commit
ed03fb4313
@ -25,13 +25,10 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import fcntl
|
|
||||||
import shutil
|
import shutil
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from qubes.qubes import QubesVmCollection
|
from qubes.qubes import QubesVmCollection
|
||||||
from qubes.qubes import QubesException
|
|
||||||
from qubes.qubes import QubesDaemonPidfile
|
|
||||||
from qubes.qubes import QubesDispVmLabels
|
from qubes.qubes import QubesDispVmLabels
|
||||||
from qubes.notify import tray_notify, tray_notify_error, tray_notify_init
|
from qubes.notify import tray_notify, tray_notify_error, tray_notify_init
|
||||||
|
|
||||||
@ -45,7 +42,8 @@ class QfileDaemonDvm:
|
|||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def get_disp_templ(self):
|
@staticmethod
|
||||||
|
def get_disp_templ():
|
||||||
vmdir = os.readlink(current_savefile_vmdir)
|
vmdir = os.readlink(current_savefile_vmdir)
|
||||||
return vmdir.split('/')[-1]
|
return vmdir.split('/')[-1]
|
||||||
|
|
||||||
@ -109,7 +107,8 @@ class QfileDaemonDvm:
|
|||||||
|
|
||||||
return dispvm
|
return dispvm
|
||||||
|
|
||||||
def dvm_setup_ok(self):
|
@staticmethod
|
||||||
|
def dvm_setup_ok():
|
||||||
dvmdata_dir = '/var/lib/qubes/dvmdata/'
|
dvmdata_dir = '/var/lib/qubes/dvmdata/'
|
||||||
if not os.path.isfile(current_savefile):
|
if not os.path.isfile(current_savefile):
|
||||||
return False
|
return False
|
||||||
@ -137,7 +136,8 @@ class QfileDaemonDvm:
|
|||||||
return None
|
return None
|
||||||
return self.do_get_dvm()
|
return self.do_get_dvm()
|
||||||
|
|
||||||
def remove_disposable_from_qdb(self, name):
|
@staticmethod
|
||||||
|
def remove_disposable_from_qdb(name):
|
||||||
qvm_collection = QubesVmCollection()
|
qvm_collection = QubesVmCollection()
|
||||||
qvm_collection.lock_db_for_writing()
|
qvm_collection.lock_db_for_writing()
|
||||||
qvm_collection.load()
|
qvm_collection.load()
|
||||||
@ -151,7 +151,6 @@ class QfileDaemonDvm:
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global notify_object
|
|
||||||
exec_index = sys.argv[1]
|
exec_index = sys.argv[1]
|
||||||
src_vmname = sys.argv[2]
|
src_vmname = sys.argv[2]
|
||||||
user = sys.argv[3]
|
user = sys.argv[3]
|
||||||
|
Loading…
Reference in New Issue
Block a user