summaryrefslogtreecommitdiff
path: root/virtManager/error.py
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2018-03-15 21:22:14 -0400
committerCole Robinson <crobinso@redhat.com>2018-03-15 21:24:48 -0400
commitdabbc8d5bdef57d018488e55f82468142bce693f (patch)
tree8408b442156217115dfff09d21d888276a9676f7 /virtManager/error.py
parent5ebe8b818493b66844fdc21e3845f7c6c41a3bde (diff)
downloadvirt-manager-dabbc8d5bdef57d018488e55f82468142bce693f.tar.gz
engine: Remove centralized conn.open handling
Move connection opening logic to each caller, since needs are slightly different.
Diffstat (limited to 'virtManager/error.py')
-rw-r--r--virtManager/error.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/virtManager/error.py b/virtManager/error.py
index 4a913545..99624234 100644
--- a/virtManager/error.py
+++ b/virtManager/error.py
@@ -49,7 +49,14 @@ def _launch_dialog(dialog, primary_text, secondary_text, title,
class vmmErrorDialog(vmmGObject):
- def __init__(self, parent=None):
+ # singleton instance for non-UI classes
+ @classmethod
+ def get_instance(cls):
+ if not cls._instance:
+ cls._instance = cls(None)
+ return cls._instance
+
+ def __init__(self, parent):
vmmGObject.__init__(self)
self._parent = parent
self._simple = None