Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Unified Diff: client/bin/base_partition.py

Issue 1595019: Merge remote branch 'origin/upstream' into tempbranch (Closed)
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/bin/harness_autoserv.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/bin/base_partition.py
diff --git a/client/bin/base_partition.py b/client/bin/base_partition.py
index 67a83e6fc52858931ea48d072df5f61f3d55ba48..2c99fcaa18c5032d3544556c4ee31e70a57fb24d 100644
--- a/client/bin/base_partition.py
+++ b/client/bin/base_partition.py
@@ -834,10 +834,10 @@ class virtual_partition:
raise error.AutotestError(e_msg)
logging.debug('Creating virtual partition')
- self.img = self.__create_disk_img(file_img, file_size)
- self.loop = self.__attach_img_loop(self.img)
- self.__create_single_partition(self.loop)
- self.device = self.__create_entries_partition(self.loop)
+ self.img = self._create_disk_img(file_img, file_size)
+ self.loop = self._attach_img_loop(self.img)
+ self._create_single_partition(self.loop)
+ self.device = self._create_entries_partition(self.loop)
logging.debug('Virtual partition successfuly created')
logging.debug('Image disk: %s', self.img)
logging.debug('Loopback device: %s', self.loop)
@@ -850,12 +850,12 @@ class virtual_partition:
from the loopback device and removes the image file.
"""
logging.debug('Removing virtual partition - device %s', self.device)
- self.__remove_entries_partition()
- self.__detach_img_loop()
- self.__remove_disk_img()
+ self._remove_entries_partition()
+ self._detach_img_loop()
+ self._remove_disk_img()
- def __create_disk_img(self, img_path, size):
+ def _create_disk_img(self, img_path, size):
"""
Creates a disk image using dd.
@@ -873,7 +873,7 @@ class virtual_partition:
return img_path
- def __attach_img_loop(self, img_path):
+ def _attach_img_loop(self, img_path):
"""
Attaches a file image to a loopback device using losetup.
@@ -894,7 +894,7 @@ class virtual_partition:
return loop_path
- def __create_single_partition(self, loop_path):
+ def _create_single_partition(self, loop_path):
"""
Creates a single partition encompassing the whole 'disk' using cfdisk.
@@ -913,7 +913,7 @@ class virtual_partition:
raise error.AutotestError(e_msg)
- def __create_entries_partition(self, loop_path):
+ def _create_entries_partition(self, loop_path):
"""
Takes the newly created partition table on the loopback device and
makes all its devices available under /dev/mapper. As we previously
@@ -935,7 +935,7 @@ class virtual_partition:
return os.path.join('/dev/mapper', device)
- def __remove_entries_partition(self):
+ def _remove_entries_partition(self):
"""
Removes the entries under /dev/mapper for the partition associated
to the loopback device.
@@ -950,7 +950,7 @@ class virtual_partition:
raise error.AutotestError(e_msg)
- def __detach_img_loop(self):
+ def _detach_img_loop(self):
"""
Detaches the image file from the loopback device.
"""
@@ -965,7 +965,7 @@ class virtual_partition:
raise error.AutotestError(e_msg)
- def __remove_disk_img(self):
+ def _remove_disk_img(self):
"""
Removes the disk image.
"""
« no previous file with comments | « no previous file | client/bin/harness_autoserv.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698