2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-15 15:53:36 +00:00

Updating the server to allow optional policy_path values

This change updates the server, updating how it processes config
values and allowing it to handle optional or ommitted policy_path
values. This fixes a bug where users could not leave the
policy_path config file unset, in addition to a bug that forced
users to use '/etc/pykmip/policies' as their policy directory.

Fixes #210
This commit is contained in:
Peter Hamilton
2016-11-28 13:09:05 -05:00
parent 023bb8fd04
commit 381e072bb7
5 changed files with 22 additions and 36 deletions

View File

@@ -134,9 +134,9 @@ class KmipEngine(object):
def _load_operation_policies(self, policy_path):
if (policy_path is None) or (not os.path.isdir(policy_path)):
self._logger.warning(
"The specified operation policy directory ({0}) is not "
"valid. No user-defined policies will be loaded".format(
policy_path
"The specified operation policy directory{0} is not "
"valid. No user-defined policies will be loaded.".format(
" (" + policy_path + ")" if policy_path else ''
)
)
return dict()
@@ -151,7 +151,7 @@ class KmipEngine(object):
file_path = os.path.join(policy_path, filename)
if os.path.isfile(file_path):
self._logger.info(
"Loading user_defined operation policies "
"Loading user-defined operation policies "
"from file: {0}".format(file_path)
)