Run a script and log the streamed script output.

    Args:
      metadata_key: string, the key specifing the metadata script.
      metadata_script: string, the file location of an executable script.

def _RunScript(self, metadata_key, metadata_script):
    """Run a script and log the streamed script output.

    Args:
      metadata_key: string, the key specifing the metadata script.
      metadata_script: string, the file location of an executable script.
    """
    process = subprocess.Popen(
        metadata_script, shell=True,
        executable=self.default_shell,
        stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
    while True:
      for line in iter(process.stdout.readline, b''):
        message = line.decode('utf-8', 'replace').rstrip('\n')
        if message:
          self.logger.info('%s: %s', metadata_key, message)
      if process.poll() is not None:
        break
    self.logger.info('%s: Return code %s.', metadata_key, process.returncode)