summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2013-01-19 16:22:37 -0600
committerBrian C. Lane <bcl@redhat.com>2013-01-28 06:35:10 -0800
commit65438a7026420311665909621585e2d094a9c4bf (patch)
tree9a5a7824132948956726f131ab62cf3f4d9b4259 /pyanaconda/ui
parentebadda74f2519c1a892c6f651eb683dd0d783e65 (diff)
downloadanaconda-65438a7026420311665909621585e2d094a9c4bf.tar.gz
anaconda-65438a7026420311665909621585e2d094a9c4bf.tar.xz
anaconda-65438a7026420311665909621585e2d094a9c4bf.zip
Use threadMgr.wait to check threads
This will raise an exception if the thread quit because of an error.
Diffstat (limited to 'pyanaconda/ui')
-rw-r--r--pyanaconda/ui/gui/spokes/custom.py4
-rw-r--r--pyanaconda/ui/gui/spokes/network.py4
-rw-r--r--pyanaconda/ui/gui/spokes/software.py12
-rw-r--r--pyanaconda/ui/gui/spokes/source.py8
-rw-r--r--pyanaconda/ui/gui/spokes/storage.py4
-rw-r--r--pyanaconda/ui/tui/spokes/storage.py12
6 files changed, 12 insertions, 32 deletions
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index d14f6bafe..94faef082 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -640,9 +640,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# Make sure the storage spoke execute method has finished before we
# copy the storage instance.
for thread_name in ["AnaExecuteStorageThread", "AnaStorageThread"]:
- t = threadMgr.get(thread_name)
- if t:
- t.join()
+ threadMgr.wait(thread_name)
self.passphrase = self.data.autopart.passphrase
self._reset_storage()
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index f89be9fde..622e72455 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -1120,9 +1120,7 @@ class NetworkStandaloneSpoke(StandaloneSpoke):
from pyanaconda.packaging import payloadInitialize
from pyanaconda.threads import threadMgr, AnacondaThread
- payloadThread = threadMgr.get("AnaPayloadThread")
- if payloadThread:
- payloadThread.join()
+ threadMgr.wait("AnaPayloadThread")
threadMgr.add(AnacondaThread(name="AnaPayloadThread", target=payloadInitialize, args=(self.storage, self.data, self.payload)))
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index cbaf8f037..859830338 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -178,9 +178,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
def _initialize(self):
communication.send_message(self.__class__.__name__, _("Downloading package metadata..."))
- payloadThread = threadMgr.get("AnaPayloadThread")
- if payloadThread:
- payloadThread.join()
+ threadMgr.wait("AnaPayloadThread")
communication.send_message(self.__class__.__name__, _("Downloading group metadata..."))
@@ -189,9 +187,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
if flags.automatedInstall and packagesSeen:
# We don't want to do a full refresh, just
# join the metadata thread
- mdGatherThread = threadMgr.get("AnaPayloadMDThread")
- if mdGatherThread:
- mdGatherThread.join()
+ threadMgr.wait("AnaPayloadMDThread")
else:
if not self._first_refresh():
return
@@ -222,9 +218,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
def refresh(self):
NormalSpoke.refresh(self)
- mdGatherThread = threadMgr.get("AnaPayloadMDThread")
- if mdGatherThread:
- mdGatherThread.join()
+ threadMgr.wait("AnaPayloadMDThread")
self._environmentStore = self.builder.get_object("environmentStore")
self._environmentStore.clear()
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 7faf0bcb2..cbd25145b 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -678,15 +678,11 @@ class SourceSpoke(NormalSpoke):
communication.send_message(self.__class__.__name__, _("Probing storage..."))
- storageThread = threadMgr.get("AnaStorageThread")
- if storageThread:
- storageThread.join()
+ threadMgr.wait("AnaStorageThread")
communication.send_message(self.__class__.__name__, _(METADATA_DOWNLOAD_MESSAGE))
- payloadThread = threadMgr.get("AnaPayloadThread")
- if payloadThread:
- payloadThread.join()
+ threadMgr.wait("AnaPayloadThread")
added = False
cdrom = None
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 9cbc6d805..9aa510f87 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -513,9 +513,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
def _initialize(self):
communication.send_message(self.__class__.__name__, _("Probing storage..."))
- storageThread = threadMgr.get("AnaStorageThread")
- if storageThread:
- storageThread.join()
+ threadMgr.wait("AnaStorageThread")
self.disks = getDisks(self.storage.devicetree)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index b5d483f15..5314438b3 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -183,11 +183,9 @@ class StorageSpoke(NormalTUISpoke):
NormalTUISpoke.refresh(self, args)
# Join the initialization thread to block on it
- initThread = threadMgr.get("AnaStorageWatcher")
- if initThread:
- # This print is foul. Need a better message display
- print(_("Probing storage..."))
- initThread.join()
+ # This print is foul. Need a better message display
+ print(_("Probing storage..."))
+ threadMgr.wait("AnaStorageWatcher")
# synchronize our local data store with the global ksdata
# Commment out because there is no way to select a disk right
@@ -301,9 +299,7 @@ class StorageSpoke(NormalTUISpoke):
# Secondary initialize so wait for the storage thread
# to complete before populating our disk list
- storageThread = threadMgr.get("AnaStorageThread")
- if storageThread:
- storageThread.join()
+ threadMgr.wait("AnaStorageThread")
self.disks = sorted(getDisks(self.storage.devicetree),
key=lambda d: d.name)