summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkurono <andres.gomez@cern.ch>2018-04-01 20:54:02 +0200
committerintrigeri <intrigeri@boum.org>2018-04-10 07:07:46 +0000
commit9107d158de1793dd7cedf409750ec0feff13b947 (patch)
treeae2ca88bb048df0fed85c14bb6979fb60c25a1ff
parent7d571cb1bdb1247c9dcc60fdfb7ccb81f559eea2 (diff)
Related to #15031:
* First check if a device is isohybrid before checking if it can be upgraded. * Also verify that the device ia not None.
-rwxr-xr-xtails_installer/creator.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/tails_installer/creator.py b/tails_installer/creator.py
index b7bf54c..ff47356 100755
--- a/tails_installer/creator.py
+++ b/tails_installer/creator.py
@@ -936,9 +936,11 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
else:
obj = self._get_object()
- # First check if we actually have found the object and then
- # if it has a partition
- if obj is None and not obj.props.partition:
+ # First check if we actually have found the object
+ if obj is None:
+ return False
+ # and then if it has a partition
+ if not obj.props.partition:
return False
partition_table = obj.props.partition_table
@@ -949,14 +951,14 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
else:
return False
- def device_can_be_upgraded(self, drive=None):
+ def device_can_be_upgraded(self, device_data=None):
# Checks that device already has Tails installed
- if not drive:
+ if not device_data:
device = self.drive
else:
- device = drive
- return self.is_partition_GPT(device) and device['fstype'] == 'vfat' \
- and device['label'] == 'Tails'
+ device = device_data
+ return not self.device_is_isohybrid(device) and self.is_partition_GPT(device) \
+ and device['fstype'] == 'vfat' and device['label'] == 'Tails'
def device_is_isohybrid(self, drive=None):
if not drive: