[Pkg-privacy-commits] [tails-installer] 32/43: partition_device: always ask udisks to give us an new object.
Ulrike Uhlig
u-guest at moszumanska.debian.org
Tue Nov 15 23:30:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
u-guest pushed a commit to branch debian/sid
in repository tails-installer.
commit 84be66a9656e4827b5aaf414f635c2d04e8268ed
Author: intrigeri <intrigeri at boum.org>
Date: Thu Jul 21 17:34:59 2016 +0000
partition_device: always ask udisks to give us an new object.
Given we need to do that for "obj" and "system_partition" already, to be
on the safe side let's should apply this discipline to other objects,
such as "block".
---
tails_installer/creator.py | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/tails_installer/creator.py b/tails_installer/creator.py
index 154fbb2..f3d55a3 100755
--- a/tails_installer/creator.py
+++ b/tails_installer/creator.py
@@ -821,10 +821,8 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
self.log.debug("Creating partition table")
# Use udisks instead of plain sgdisk will allow unprivileged users
# to get a refreshed partition table from the kernel
- obj = self._get_object()
- block = obj.props.block
try:
- block.call_format_sync(
+ self._get_object().props.block.call_format_sync(
'gpt',
arg_options=GLib.Variant('a{sv}', None),
cancellable=None)
@@ -836,7 +834,7 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
self.log.debug("Failed to synchronize. Trying again, which usually solves the issue. Error was: %s" % e.message)
self.flush_buffers(silent=True)
time.sleep(5)
- block.call_format_sync(
+ self._get_object().props.block.call_format_sync(
'gpt',
arg_options=GLib.Variant('a{sv}', None),
cancellable=None)
@@ -844,7 +842,7 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
raise
self.log.debug("Creating partition")
- partition_table = obj.props.partition_table
+ partition_table = self._get_object().props.partition_table
try:
partition_table.call_create_partition_sync(
arg_offset=0,
@@ -866,7 +864,7 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
# Rescan the device as it seems this is not always done automatically.
# And get the new object after the rescan, then its 1st partition
# which is the one we just created on our new partition table.
- self.rescan_block_device(block)
+ self.rescan_block_device(self._get_object().props.block)
system_partition = self.first_partition(self.drive['udi'])
# Sets the partition type that is not set by call_create_partition_sync...
@@ -878,7 +876,7 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
# Get a fresh system_partition object
# (https://labs.riseup.net/code/issues/10720#note-28)
- self.rescan_block_device(block)
+ self.rescan_block_device(self._get_object().props.block)
system_partition = self.first_partition(self.drive['udi'])
# XXX: sometimes fails (https://labs.riseup.net/code/issues/10987)
@@ -886,7 +884,7 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
# XXX: give the system some more time to recognize the updated partition
# (https://labs.riseup.net/code/issues/10720#note-30)
- self.rescan_block_device(block)
+ self.rescan_block_device(self._get_object().props.block)
def update_system_partition_properties(self):
self.log.info(_('Updating properties of system partition %(system_partition)s') % {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git
More information about the Pkg-privacy-commits
mailing list