def _ReadSizeOfPartition(self, name): # Tests uses *_image_size instead (to avoid creating empty sparse images # on disk) if name + "_image_size" in self.info_dict: return int(self.info_dict[name + "_image_size"]) return sparse_img.GetImagePartitionSize(self.info_dict[name + "_image"])
def GetArgumentsForImage(partition, group, image=None): image_size = sparse_img.GetImagePartitionSize(image) if image else 0 cmd = ["--partition", "{}:readonly:{}:{}".format(partition, image_size, group)] if image: cmd += ["--image", "{}={}".format(partition, image)] return cmd