Added ca_host, ca_port, and ca_ssl_port Env variables that Andrew requested

This commit is contained in:
Jason Gerard DeRose 2009-01-22 10:59:46 -07:00 committed by Rob Crittenden
parent 6aadeb9aea
commit 12c4879613
3 changed files with 11 additions and 1 deletions

View File

@ -701,7 +701,7 @@ plugin (or plugins) is imported. For example:
1
>>> api.bootstrap(in_server=True) # We want to execute, not forward
>>> len(api.env)
32
36
`Env._bootstrap()`, which is called by `API.bootstrap()`, will create several
run-time variables that connot be overriden in configuration files or through

View File

@ -34,6 +34,7 @@ from types import NoneType
import os
from os import path
import sys
from socket import gethostname
from base import check_name
from constants import CONFIG_SECTION
@ -426,6 +427,7 @@ class Env(object):
self.__doing('_bootstrap')
# Set run-time variables:
self.host = gethostname()
self.ipalib = path.dirname(path.abspath(__file__))
self.site_packages = path.dirname(self.ipalib)
self.script = path.abspath(sys.argv[0])
@ -499,6 +501,8 @@ class Env(object):
self.log = path.join(self.dot_ipa, 'log', name)
else:
self.log = path.join('/', 'var', 'log', 'ipa', name)
if 'ca_host' not in self:
self.ca_host = self.host
self._merge(**defaults)
def _finalize(self, **lastchance):

View File

@ -99,6 +99,11 @@ DEFAULT_CONFIG = (
('debug', False),
('mode', 'production'),
# CA plugin:
('ca_host', object), # Set in Env._finalize_core()
('ca_port', 9180),
('ca_ssl_port', 9443),
# ********************************************************
# The remaining keys are never set from the values here!
# ********************************************************
@ -116,6 +121,7 @@ DEFAULT_CONFIG = (
# raised.
# Set in Env.__init__():
('host', object),
('ipalib', object), # The directory containing ipalib/__init__.py
('site_packages', object), # The directory contaning ipalib
('script', object), # sys.argv[0]