Ejemplo n.º 1
0
    def _preprocess(self, _):
        self.device_path, partition_paths = google_cloud.PreprocessAttachDisk(
            self.disk_name)

        self.mount_path = mount_local.PreprocessMountDisk(
            partition_paths, self.mount_partition)
        self.local_path = self.device_path
Ejemplo n.º 2
0
    def _preprocess(self, _, required_states):
        if EvidenceState.ATTACHED in required_states:
            self.device_path, partition_paths = google_cloud.PreprocessAttachDisk(
                self.disk_name)
            self.state[EvidenceState.ATTACHED] = True

        if EvidenceState.MOUNTED in required_states:
            self.mount_path = mount_local.PreprocessMountDisk(
                partition_paths, self.mount_partition)
            self.local_path = self.device_path
            self.state[EvidenceState.MOUNTED] = True
Ejemplo n.º 3
0
  def _preprocess(self, _, required_states):
    # The GoogleCloudDisk should never need to be mounted unless it has child
    # evidence (GoogleCloudDiskRawEmbedded). In all other cases, the
    # DiskPartition evidence will be used. In this case we're breaking the
    # evidence layer isolation and having the child evidence manage the
    # mounting and unmounting.

    if EvidenceState.ATTACHED in required_states:
      self.device_path, partition_paths = google_cloud.PreprocessAttachDisk(
          self.disk_name)
      self.partition_paths = partition_paths
      self.local_path = self.device_path
      self.state[EvidenceState.ATTACHED] = True
Ejemplo n.º 4
0
    def _preprocess(self, _, required_states):
        # The GoogleCloudDisk should never need to be mounted unless it has child
        # evidence (GoogleCloudDiskRawEmbedded). In all other cases, the
        # DiskPartition evidence will be used. In this case we're breaking the
        # evidence layer isolation and having the child evidence manage the
        # mounting and unmounting.

        # Explicitly lock this method to prevent race condition with two workers
        # attempting to attach disk at same time, given delay with attaching in GCP.
        with filelock.FileLock(config.RESOURCE_FILE_LOCK):
            if EvidenceState.ATTACHED in required_states:
                self.device_path, partition_paths = google_cloud.PreprocessAttachDisk(
                    self.disk_name)
                self.partition_paths = partition_paths
                self.local_path = self.device_path
                self.state[EvidenceState.ATTACHED] = True
Ejemplo n.º 5
0
 def _preprocess(self):
   self.local_path = google_cloud.PreprocessAttachDisk(self.disk_name)
   self.loopdevice_path = mount_local.PreprocessLosetup(self.local_path)
   self.mount_path = mount_local.PreprocessMountDisk(
       self.loopdevice_path, self.mount_partition)
   self.local_path = os.path.join(self.mount_path, self.embedded_path)
Ejemplo n.º 6
0
 def _preprocess(self):
   self.local_path = google_cloud.PreprocessAttachDisk(self.disk_name)
Ejemplo n.º 7
0
 def preprocess(self):
     google_cloud.PreprocessAttachDisk(self)
     mount_local.PreprocessMountDisk(self)
     self.local_path = os.path.join(self.mount_path, self.embedded_path)
Ejemplo n.º 8
0
 def preprocess(self):
     google_cloud.PreprocessAttachDisk(self)