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

Updating the set of supported configuration file locations

This change adds support for multiple configuration file storage
locations, including the user's home directory and /etc. The preferred
configuration file name is now pykmip.conf. The original name,
kmipconfig.ini, will continue to be supported for legacy installations.
This commit is contained in:
Peter Hamilton
2015-08-25 13:13:58 -04:00
parent 9c7edd65d2
commit 3a4658d5d1
3 changed files with 25 additions and 8 deletions

View File

@@ -19,7 +19,13 @@ import os
from six.moves.configparser import SafeConfigParser
FILE_PATH = os.path.dirname(os.path.abspath(__file__))
CONFIG_FILE = os.path.normpath(os.path.join(FILE_PATH, '../kmipconfig.ini'))
# TODO (peter-hamilton): Remove support for kmipconfig.ini on future release.
CONFIG_FILE = [
os.path.join(os.path.expanduser('~'), '.pykmip', 'pykmip.conf'),
os.path.join(os.sep, 'etc', 'pykmip', 'pykmip.conf'),
os.path.normpath(os.path.join(FILE_PATH, '../pykmip.conf')),
os.path.normpath(os.path.join(FILE_PATH, '../kmipconfig.ini'))]
class ConfigHelper(object):