1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

lvmdbus: Fix deprecated warnings for GObject use

While running on F24 a number of warnings were being emitted from using the
deprecated GObject instead of GLib.  Tested on python 3.4 and 3.5.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
This commit is contained in:
Tony Asleson 2016-03-08 16:04:44 -06:00
parent 3f5629302a
commit 6d19c14c28
2 changed files with 5 additions and 6 deletions
daemons/lvmdbusd

View File

@ -18,7 +18,7 @@ import signal
import dbus import dbus
from . import lvmdb from . import lvmdb
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from gi.repository import GObject from gi.repository import GLib
from .fetch import load from .fetch import load
from .manager import Manager from .manager import Manager
from .background import background_reaper from .background import background_reaper
@ -123,7 +123,6 @@ def main():
pass pass
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
GObject.threads_init()
dbus.mainloop.glib.threads_init() dbus.mainloop.glib.threads_init()
if use_session: if use_session:
@ -148,7 +147,7 @@ def main():
thread_list.append(threading.Thread(target=process_request)) thread_list.append(threading.Thread(target=process_request))
cfg.load(refresh=False, emit_signal=False) cfg.load(refresh=False, emit_signal=False)
cfg.loop = GObject.MainLoop() cfg.loop = GLib.MainLoop()
for process in thread_list: for process in thread_list:
process.damon = True process.damon = True

View File

@ -9,7 +9,7 @@
import threading import threading
# noinspection PyUnresolvedReferences # noinspection PyUnresolvedReferences
from gi.repository import GObject from gi.repository import GLib
from .job import Job from .job import Job
from . import cfg from . import cfg
import traceback import traceback
@ -40,7 +40,7 @@ class RequestEntry(object):
elif tmo == 0: elif tmo == 0:
self._return_job() self._return_job()
else: else:
self.timer_id = GObject.timeout_add_seconds( self.timer_id = GLib.timeout_add_seconds(
tmo, RequestEntry._request_timeout, self) tmo, RequestEntry._request_timeout, self)
@staticmethod @staticmethod
@ -93,7 +93,7 @@ class RequestEntry(object):
self.done = True self.done = True
if self.timer_id != -1: if self.timer_id != -1:
# Try to prevent the timer from firing # Try to prevent the timer from firing
GObject.source_remove(self.timer_id) GLib.source_remove(self.timer_id)
self._result = result self._result = result
self._rc = error_rc self._rc = error_rc