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