original_docstring: The path to the war file for Gerrit.
  
      :returns: path to a war file or None
      :rtype: Union[str, None]
docstring: The path to the war file for Gerrit.
docstring_tokens: The path to the war file for Gerrit .
code: def gerrit_war():
      """The path to the war file for Gerrit.
  
      :returns: path to a war file or None
      :rtype: Union[str, None]"""
      res = resource_get('gerrit')
      if res:
          return res
      dest_dir = os.path.join(os.environ.get('CHARM_DIR'), 'fetched')
      if not os.path.exists(dest_dir):
          mkdir(dest_dir, perms=0o755)
      dld_file = os.path.join(dest_dir, "gerrit-3.1.2.war")
      response = urlopen(
          "https://gerrit-releases.storage.googleapis.com/gerrit-3.1.2.war")
      try:
          with open(dld_file, 'wb') as dest_file:
              dest_file.write(response.read())
      except Exception as e:
          if os.path.isfile(dld_file):
              os.unlink(dld_file)
          logging.warn("Error downloading gerrit: {}".format(e))
          return None
      return dld_file
code_tokens: def gerrit_war ( ) : res = resource_get ( 'gerrit' ) if res : return res dest_dir = os . path . join ( os . environ . get ( 'CHARM_DIR' ) , 'fetched' ) if not os . path . exists ( dest_dir ) : mkdir ( dest_dir , perms = 0o755 ) dld_file = os . path . join ( dest_dir , "gerrit-3.1.2.war" ) response = urlopen ( "https://gerrit-releases.storage.googleapis.com/gerrit-3.1.2.war" ) try : with open ( dld_file , 'wb' ) as dest_file : dest_file . write ( response . read ( ) ) except Exception as e : if os . path . isfile ( dld_file ) : os . unlink ( dld_file ) logging . warn ( "Error downloading gerrit: {}" . format ( e ) ) return None return dld_file
short_docstring: The path to the war file for Gerrit.
short_docstring_tokens: The path to the war file for Gerrit .
comment: """The path to the war file for Gerrit.
  
      :returns: path to a war file or None
      :rtype: Union[str, None]"""