本文整理汇总了Python中charmhelpers.contrib.hardening.apache.checks.config.get_audits方法的典型用法代码示例。如果您正苦于以下问题:Python config.get_audits方法的具体用法?Python config.get_audits怎么用?Python config.get_audits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类charmhelpers.contrib.hardening.apache.checks.config
的用法示例。
在下文中一共展示了config.get_audits方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_apache_checks
# 需要导入模块: from charmhelpers.contrib.hardening.apache.checks import config [as 别名]
# 或者: from charmhelpers.contrib.hardening.apache.checks.config import get_audits [as 别名]
def run_apache_checks():
log("Starting Apache hardening checks.", level=DEBUG)
checks = config.get_audits()
for check in checks:
log("Running '%s' check" % (check.__class__.__name__), level=DEBUG)
check.ensure_compliance()
log("Apache hardening checks complete.", level=DEBUG)
示例2: test_get_audits_apache_not_installed
# 需要导入模块: from charmhelpers.contrib.hardening.apache.checks import config [as 别名]
# 或者: from charmhelpers.contrib.hardening.apache.checks.config import get_audits [as 别名]
def test_get_audits_apache_not_installed(self):
audits = config.get_audits()
self.assertEqual([], audits)
示例3: test_get_audits_apache_is_installed
# 需要导入模块: from charmhelpers.contrib.hardening.apache.checks import config [as 别名]
# 或者: from charmhelpers.contrib.hardening.apache.checks.config import get_audits [as 别名]
def test_get_audits_apache_is_installed(self):
audits = config.get_audits()
self.assertEqual(7, len(audits))
示例4: test_file_permission_audit
# 需要导入模块: from charmhelpers.contrib.hardening.apache.checks import config [as 别名]
# 或者: from charmhelpers.contrib.hardening.apache.checks.config import get_audits [as 别名]
def test_file_permission_audit(self):
audits = config.get_audits()
settings = config.utils.get_settings('apache')
conf_file_name = 'apache2.conf'
conf_file_path = os.path.join(
settings['common']['apache_dir'], conf_file_name
)
self.assertEqual(audits[0].paths[0], conf_file_path)