summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyanaconda/dispatch.py12
-rw-r--r--pyanaconda/kickstart.py2
-rw-r--r--pyanaconda/yuminstall.py3
-rw-r--r--tests/pyanaconda_test/dispatch_test.py14
4 files changed, 18 insertions, 13 deletions
diff --git a/pyanaconda/dispatch.py b/pyanaconda/dispatch.py
index 18bfa58a9..85e66b044 100644
--- a/pyanaconda/dispatch.py
+++ b/pyanaconda/dispatch.py
@@ -24,7 +24,6 @@ import string
from types import *
import indexed_dict
-import errors
from constants import *
from packages import writeKSConfiguration, turnOnFilesystems
from packages import doPostAction
@@ -56,6 +55,9 @@ from packages import doReIPL
import logging
log = logging.getLogger("anaconda")
+class DispatchError(Exception):
+ pass
+
class Step(object):
SCHED_UNSCHEDULED = 0
SCHED_SCHEDULED = 1 # will execute if not explicitly skipped
@@ -93,7 +95,7 @@ class Step(object):
s_from = self.sched
new_sched = self.sched_state_machine[self.sched][to_sched]
if new_sched is False:
- raise errors.DispatchError(
+ raise DispatchError(
"Can not reschedule step '%s' from '%s' to '%s'" %
(self.name,
self.namesched(self._sched),
@@ -307,7 +309,7 @@ class Dispatcher(object):
for step in steps:
try:
self.request_steps(step)
- except errors.DispatchError as e:
+ except DispatchError as e:
log.debug("dispatch: %s" % e)
def reset_scheduling(self):
@@ -315,7 +317,7 @@ class Dispatcher(object):
for step in self.steps:
try:
self.steps[step].unschedule(self._current_step())
- except errors.DispatchError as e:
+ except DispatchError as e:
log.debug("dispatch: %s" % e)
log.info("dispatch: resetting finished.")
@@ -333,7 +335,7 @@ class Dispatcher(object):
for step in steps:
try:
self.schedule_steps(step)
- except errors.DispatchError as e:
+ except DispatchError as e:
log.debug("dispatch: %s" % e)
def step_data(self, step):
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 0c1e73ef2..d3cb8dbf3 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -29,7 +29,7 @@ import storage.iscsi
import storage.fcoe
import storage.zfcp
-from errors import *
+from yuminstall import NoSuchGroup
import iutil
import isys
import os
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index c132b317d..084bd7390 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -72,6 +72,9 @@ urlgrabber.grabber.default_grabber.opts.user_agent = "%s (anaconda)/%s" %(produc
import iutil
import isys
+class NoSuchGroup(Exception):
+ pass
+
def size_string (size):
def number_format(s):
return locale.format("%s", s, 1)
diff --git a/tests/pyanaconda_test/dispatch_test.py b/tests/pyanaconda_test/dispatch_test.py
index 9f2fac1ca..669ec534f 100644
--- a/tests/pyanaconda_test/dispatch_test.py
+++ b/tests/pyanaconda_test/dispatch_test.py
@@ -13,7 +13,7 @@ class StepTest(mock.TestCase):
def done_test(self):
from pyanaconda.dispatch import Step
- from pyanaconda.errors import DispatchError
+ from pyanaconda.dispatch import DispatchError
s = Step("a_step")
s.schedule(None)
s.request(None)
@@ -37,7 +37,7 @@ class StepTest(mock.TestCase):
def reschedule_test(self):
from pyanaconda.dispatch import Step
- from pyanaconda.errors import DispatchError
+ from pyanaconda.dispatch import DispatchError
s = Step("a_step")
s._reschedule(Step.SCHED_UNSCHEDULED, None)
self.assertEqual(s.sched, Step.SCHED_UNSCHEDULED)
@@ -59,7 +59,7 @@ class StepTest(mock.TestCase):
def request_test(self):
from pyanaconda.dispatch import Step
- from pyanaconda.errors import DispatchError
+ from pyanaconda.dispatch import DispatchError
s = Step("a_step")
s.request(None)
self.assertRaises(DispatchError, s.skip, None)
@@ -72,7 +72,7 @@ class StepTest(mock.TestCase):
def unschedule_test(self):
from pyanaconda.dispatch import Step
- from pyanaconda.errors import DispatchError
+ from pyanaconda.dispatch import DispatchError
s = Step("a_step")
s.schedule(None)
self.assertEquals(s.sched, Step.SCHED_SCHEDULED)
@@ -84,7 +84,7 @@ class StepTest(mock.TestCase):
def skip_test(self):
from pyanaconda.dispatch import Step
- from pyanaconda.errors import DispatchError
+ from pyanaconda.dispatch import DispatchError
s = Step("a_step")
s.skip(None)
self.assertEquals(s.sched, Step.SCHED_SKIPPED)
@@ -162,7 +162,7 @@ class DispatchTest(mock.TestCase):
def done_test(self):
from pyanaconda.dispatch import Dispatcher
from pyanaconda.dispatch import Step
- from pyanaconda.errors import DispatchError
+ from pyanaconda.dispatch import DispatchError
d = self._getDispatcher()
self.assertFalse(d.step_enabled("betanag"))
@@ -197,7 +197,7 @@ class DispatchTest(mock.TestCase):
self.assertTrue(d.step_enabled("filtertype"))
def request_steps_gently_test(self):
- from pyanaconda.errors import DispatchError
+ from pyanaconda.dispatch import DispatchError
from pyanaconda.dispatch import Step
d = self._getDispatcher()
d.schedule_steps("betanag", "complete")