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:
@@ -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)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user