mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add missing docstrings to kernel_keyring.py
Signed-off-by: Alexander Scheel <ascheel@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
parent
3322aad7da
commit
fc0f6b4351
@ -60,6 +60,12 @@ def get_real_key(key):
|
|||||||
|
|
||||||
|
|
||||||
def get_persistent_key(key):
|
def get_persistent_key(key):
|
||||||
|
"""
|
||||||
|
Fetches the value of a persistent key from storage, trimming trailing
|
||||||
|
any tailing whitespace.
|
||||||
|
|
||||||
|
Assert when key is not a string-type.
|
||||||
|
"""
|
||||||
assert isinstance(key, six.string_types)
|
assert isinstance(key, six.string_types)
|
||||||
result = run([paths.KEYCTL, 'get_persistent', KEYRING, key],
|
result = run([paths.KEYCTL, 'get_persistent', KEYRING, key],
|
||||||
raiseonerr=False, capture_output=True)
|
raiseonerr=False, capture_output=True)
|
||||||
@ -69,6 +75,9 @@ def get_persistent_key(key):
|
|||||||
|
|
||||||
|
|
||||||
def is_persistent_keyring_supported():
|
def is_persistent_keyring_supported():
|
||||||
|
"""
|
||||||
|
Returns True if the kernel persistent keyring is supported.
|
||||||
|
"""
|
||||||
uid = os.geteuid()
|
uid = os.geteuid()
|
||||||
try:
|
try:
|
||||||
get_persistent_key(str(uid))
|
get_persistent_key(str(uid))
|
||||||
|
Loading…
Reference in New Issue
Block a user