forked from Krautspace/doorstatus
add docstrings to print_ciphers() and display_peercert()
This commit is contained in:
parent
ee233e65e0
commit
028f7ae2de
1 changed files with 11 additions and 2 deletions
13
statusd.py
13
statusd.py
|
@ -13,7 +13,7 @@ import os
|
||||||
import logging
|
import logging
|
||||||
import json
|
import json
|
||||||
from time import time, ctime, sleep
|
from time import time, ctime, sleep
|
||||||
from sys import exit, byteorder
|
from sys import exit
|
||||||
|
|
||||||
|
|
||||||
def read_config(CONFIGFILE, CONFIG):
|
def read_config(CONFIGFILE, CONFIG):
|
||||||
|
@ -80,6 +80,11 @@ def print_config(CONFIG):
|
||||||
|
|
||||||
|
|
||||||
def print_ciphers(cipherlist):
|
def print_ciphers(cipherlist):
|
||||||
|
'''
|
||||||
|
This function prints the list of the allowed ciphers.
|
||||||
|
param1: dictionary
|
||||||
|
return: boolean
|
||||||
|
'''
|
||||||
print('Available ciphers')
|
print('Available ciphers')
|
||||||
for i in cipherlist:
|
for i in cipherlist:
|
||||||
print('\n')
|
print('\n')
|
||||||
|
@ -90,6 +95,11 @@ def print_ciphers(cipherlist):
|
||||||
|
|
||||||
|
|
||||||
def display_peercert(cert):
|
def display_peercert(cert):
|
||||||
|
'''
|
||||||
|
This function displays the values of a given certificate.
|
||||||
|
param1: dictionary
|
||||||
|
return: boolean
|
||||||
|
'''
|
||||||
for i in cert.keys():
|
for i in cert.keys():
|
||||||
print('{}:'.format(i))
|
print('{}:'.format(i))
|
||||||
if i in ('subject', 'issuer'):
|
if i in ('subject', 'issuer'):
|
||||||
|
@ -206,7 +216,6 @@ def read_loglevel(CONFIG):
|
||||||
elif CONFIG['VERBOSITY'] == 'debug':
|
elif CONFIG['VERBOSITY'] == 'debug':
|
||||||
loglevel = logging.DEBUG
|
loglevel = logging.DEBUG
|
||||||
else: loglevel = False
|
else: loglevel = False
|
||||||
print(loglevel)
|
|
||||||
return(loglevel)
|
return(loglevel)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue