summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DistUpgrade/DistUpgradeControler.py16
-rw-r--r--UpdateManager/Common/aptsources.py4
2 files changed, 15 insertions, 5 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 5e5902c6..fce38b13 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -65,7 +65,16 @@ class AptCdrom(object):
cdrom = apt_pkg.GetCdrom()
# FIXME: add cdrom progress here for the view
progress = apt.progress.CdromProgress()
- res = cdrom.Add(progress)
+ try:
+ res = cdrom.Add(progress)
+ except SystemError, e:
+ logging.error("can't add cdrom: %s" % e)
+ self.view.error(_("Failed to add the CD"),
+ _("There was a error adding the CD, the "
+ "upgrade will abort. Please report this as "
+ "a bugIf this is a valid Ubuntu CD.\n\n"
+ "The error message was:\n'%s'" % e))
+ return False
logging.debug("AptCdrom.add() returned: %s" % res)
return res
@@ -524,8 +533,9 @@ class DistUpgradeControler(object):
self.abort(1)
# add cdrom (if we have one)
- if self.aptcdrom:
- self.aptcdrom.add(self.sources_backup_ext)
+ if (self.aptcdrom and
+ not self.aptcdrom.add(self.sources_backup_ext)):
+ sys.exit(1)
# run a "apt-get update" now
if not self.doUpdate():
diff --git a/UpdateManager/Common/aptsources.py b/UpdateManager/Common/aptsources.py
index 80781cb0..38b1bd92 100644
--- a/UpdateManager/Common/aptsources.py
+++ b/UpdateManager/Common/aptsources.py
@@ -32,8 +32,8 @@ import os.path
#import pdb
-from UpdateManager.Common.DistInfo import DistInfo
-
+#from UpdateManager.Common.DistInfo import DistInfo
+from DistInfo import DistInfo
# some global helpers
def is_mirror(master_uri, compare_uri):