diff options
| author | Endi S. Dewata <edewata@redhat.com> | 2017-03-01 07:08:11 +0100 |
|---|---|---|
| committer | Endi S. Dewata <edewata@redhat.com> | 2017-03-01 18:02:27 +0100 |
| commit | 7810a55d0b967ff5355312e952fc4c7314a45f35 (patch) | |
| tree | 3095ce5d63821b122b69588882a8434d3eb8fb36 /base/server/python | |
| parent | d7c22171b84b7d8f7a068be42b07a53c8092eb48 (diff) | |
| download | pki-7810a55d0b967ff5355312e952fc4c7314a45f35.tar.gz pki-7810a55d0b967ff5355312e952fc4c7314a45f35.tar.xz pki-7810a55d0b967ff5355312e952fc4c7314a45f35.zip | |
Refactored PKIInstance.load().
The code that loads the password.conf in PKIInstance.load() has
been converted into a general purpose load_properties() method.
A corresponding store_properties() method has been added as well.
Diffstat (limited to 'base/server/python')
| -rw-r--r-- | base/server/python/pki/server/__init__.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/base/server/python/pki/server/__init__.py b/base/server/python/pki/server/__init__.py index d556312a7..70734c3db 100644 --- a/base/server/python/pki/server/__init__.py +++ b/base/server/python/pki/server/__init__.py @@ -568,19 +568,7 @@ class PKIInstance(object): # load passwords self.passwords.clear() if os.path.exists(self.password_conf): - - lines = open(self.password_conf).read().splitlines() - - for index, line in enumerate(lines): - if not line or line.startswith('#'): - continue - parts = line.split('=', 1) - if len(parts) < 2: - raise Exception('Missing delimiter in %s line %d' % - (self.password_conf, index + 1)) - name = parts[0] - value = parts[1] - self.passwords[name] = value + pki.util.load_properties(self.password_conf, self.passwords) self.load_external_certs(self.external_certs_conf) |
