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

Side by Side Diff: client/bin/partition.py

Issue 6246035: Merge remote branch 'cros/upstream' into master (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 """ 1 """
2 APIs to write tests and control files that handle partition creation, deletion 2 APIs to write tests and control files that handle partition creation, deletion
3 and formatting. 3 and formatting.
4 4
5 @copyright: Google 2006-2008 5 @copyright: Google 2006-2008
6 @author: Martin Bligh (mbligh@google.com) 6 @author: Martin Bligh (mbligh@google.com)
7 """ 7 """
8 8
9 import os, re, string, sys, fcntl, logging 9 import os, re, string, sys, fcntl, logging
10 from autotest_lib.client.bin import os_dep, utils 10 from autotest_lib.client.bin import os_dep, utils
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 178
179 def get_mount_info(partition_list): 179 def get_mount_info(partition_list):
180 """ 180 """
181 Picks up mount point information about the machine mounts. By default, we 181 Picks up mount point information about the machine mounts. By default, we
182 try to associate mount points with UUIDs, because in newer distros the 182 try to associate mount points with UUIDs, because in newer distros the
183 partitions are uniquely identified using them. 183 partitions are uniquely identified using them.
184 """ 184 """
185 mount_info = set() 185 mount_info = set()
186 for p in partition_list: 186 for p in partition_list:
187 try: 187 try:
188 uuid = utils.system_output('blkid -s UUID -o value %s' % p.device) 188 uuid = utils.system_output('blkid -p -s UUID -o value %s' % p.device )
189 except error.CmdError: 189 except error.CmdError:
190 # fall back to using the partition 190 # fall back to using the partition
191 uuid = p.device 191 uuid = p.device
192 mount_info.add((uuid, p.get_mountpoint())) 192 mount_info.add((uuid, p.get_mountpoint()))
193 193
194 return mount_info 194 return mount_info
195 195
196 196
197 def filter_partition_list(partitions, devnames): 197 def filter_partition_list(partitions, devnames):
198 """ 198 """
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 os.remove(self.img) 991 os.remove(self.img)
992 except: 992 except:
993 e_msg = 'Error removing image file %s' % self.img 993 e_msg = 'Error removing image file %s' % self.img
994 raise error.AutotestError(e_msg) 994 raise error.AutotestError(e_msg)
995 995
996 # import a site partition module to allow it to override functions 996 # import a site partition module to allow it to override functions
997 try: 997 try:
998 from autotest_lib.client.bin.site_partition import * 998 from autotest_lib.client.bin.site_partition import *
999 except ImportError: 999 except ImportError:
1000 pass 1000 pass
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698