letsencrypt.le_util¶
Utilities for all Let’s Encrypt.
-
class
letsencrypt.le_util.Key(file, pem)¶ Bases:
tuple-
_asdict()¶ Return a new OrderedDict which maps field names to their values
-
classmethod
_make(iterable, new=<built-in method __new__ of type object at 0x9192c0>, len=<built-in function len>)¶ Make a new Key object from a sequence or iterable
-
_replace(_self, **kwds)¶ Return a new Key object replacing specified fields with new values
-
file¶ Alias for field number 0
-
pem¶ Alias for field number 1
-
-
class
letsencrypt.le_util.CSR(file, data, form)¶ Bases:
tuple-
_asdict()¶ Return a new OrderedDict which maps field names to their values
-
classmethod
_make(iterable, new=<built-in method __new__ of type object at 0x9192c0>, len=<built-in function len>)¶ Make a new CSR object from a sequence or iterable
-
_replace(_self, **kwds)¶ Return a new CSR object replacing specified fields with new values
-
data¶ Alias for field number 1
-
file¶ Alias for field number 0
-
form¶ Alias for field number 2
-
-
letsencrypt.le_util.run_script(params)[source]¶ Run the script with the given params.
Parameters: params (list) – List of parameters to pass to Popen
-
letsencrypt.le_util.exe_exists(exe)[source]¶ Determine whether path/name refers to an executable.
Parameters: exe (str) – Executable path or name Returns: If exe is a valid executable Return type: bool
-
letsencrypt.le_util.make_or_verify_dir(directory, mode=493, uid=0, strict=False)[source]¶ Make sure directory exists with proper permissions.
Parameters: Raises: - .errors.Error – if a directory already exists, but has wrong permissions or owner
- OSError – if invalid or inaccessible file names and paths, or other arguments that have the correct type, but are not accepted by the operating system.
-
letsencrypt.le_util.check_permissions(filepath, mode, uid=0)[source]¶ Check file or directory permissions.
Parameters: Returns: True if
modeanduidmatch, False otherwise.Return type:
-
letsencrypt.le_util.safe_open(path, mode='w', chmod=None, buffering=None)[source]¶ Safely open a file.
Parameters:
-
letsencrypt.le_util.unique_file(path, mode=511)[source]¶ Safely finds a unique file.
Parameters: Returns: tuple of file object and file name
-
letsencrypt.le_util.unique_lineage_name(path, filename, mode=511)[source]¶ Safely finds a unique file using lineage convention.
Parameters: Returns: tuple of file object and file name (which may be modified from the requested one by appending digits to ensure uniqueness)
Raises OSError: if writing files fails for an unanticipated reason, such as a full disk or a lack of permission to write to specified location.
-
letsencrypt.le_util.get_os_info()[source]¶ Get Operating System type/distribution and major version
Returns: (os_name, os_version) Return type: tupleofstr
-
letsencrypt.le_util.add_deprecated_argument(add_argument, argument_name, nargs)[source]¶ Adds a deprecated argument with the name argument_name.
Deprecated arguments are not shown in the help. If they are used on the command line, a warning is shown stating that the argument is deprecated and no other action is taken.
Parameters: