config_directory=[]
with open("/etc/httpd/conf/httpd.conf", "r") as search_file:
for line in search_file:
if 'IncludeOptional' in line:
config_directory.append(line)
print config_directory[0]
import os
config_files=[]
webserver_config="/etc/httpd/conf.d/"
for root, dirs, files in os.walk(webserver_config):
for file in files:
if file.endswith(".conf"):
config_files.append(os.path.join(root, file))
for print_config in config_files: print print_config