parameters: (self, error_on_unknown_keys=False)
docstring: Validate the content of the archive object. Raise an Error if
         an invalid or missing field is found.
  
      Args:
        error_on_unknown_keys: If True, raise an Error when unknown keys are
        found in the archive.
docstring_summary: Validate the content of the archive object. Raise an Error if
         an invalid or missing field is found.
docstring_tokens: Validate the content of the archive object . Raise an Error if an invalid or missing field is found .
function: def Validate(self, error_on_unknown_keys=False):
      """Validate the content of the archive object. Raise an Error if
         an invalid or missing field is found.
  
      Args:
        error_on_unknown_keys: If True, raise an Error when unknown keys are
        found in the archive.
      """
      host_os = self.get('host_os', None)
      if host_os and host_os not in HOST_OS_LITERALS:
        raise Error('Invalid host-os name in archive')
      # Ensure host_os has a valid string. We'll use it for pretty printing.
      if not host_os:
        host_os = 'all (default)'
      if not self.get('url', None):
        raise Error('Archive "%s" has no URL' % host_os)
      if not self.get('size', None):
        raise Error('Archive "%s" has no size' % host_os)
      checksum = self.get('checksum', None)
      if not checksum:
        raise Error('Archive "%s" has no checksum' % host_os)
      elif not isinstance(checksum, dict):
        raise Error('Archive "%s" has a checksum, but it is not a dict' % host_os)
      elif not len(checksum):
        raise Error('Archive "%s" has an empty checksum dict' % host_os)
      # Verify that all key names are valid.
      if error_on_unknown_keys:
        for key in self:
          if key not in VALID_ARCHIVE_KEYS:
            raise Error('Archive "%s" has invalid attribute "%s"' % (
                host_os, key))
function_tokens: def Validate ( self , error_on_unknown_keys = False ) : host_os = self . get ( 'host_os' , None ) if host_os and host_os not in HOST_OS_LITERALS : raise Error ( 'Invalid host-os name in archive' ) # Ensure host_os has a valid string. We'll use it for pretty printing. if not host_os : host_os = 'all (default)' if not self . get ( 'url' , None ) : raise Error ( 'Archive "%s" has no URL' % host_os ) if not self . get ( 'size' , None ) : raise Error ( 'Archive "%s" has no size' % host_os ) checksum = self . get ( 'checksum' , None ) if not checksum : raise Error ( 'Archive "%s" has no checksum' % host_os ) elif not isinstance ( checksum , dict ) : raise Error ( 'Archive "%s" has a checksum, but it is not a dict' % host_os ) elif not len ( checksum ) : raise Error ( 'Archive "%s" has an empty checksum dict' % host_os ) # Verify that all key names are valid. if error_on_unknown_keys : for key in self : if key not in VALID_ARCHIVE_KEYS : raise Error ( 'Archive "%s" has invalid attribute "%s"' % ( host_os , key ) )