diff options
author | Justin Hammond <justin.hammond@rackspace.com> | 2012-12-17 11:07:05 -0600 |
---|---|---|
committer | Justin Hammond <justin.hammond@rackspace.com> | 2012-12-17 12:15:41 -0600 |
commit | aef4f3c40a05a35759054059a44dda8a478da443 (patch) | |
tree | 060b75155c71369e235cb61b1166dbf0b924f2a4 /nova/compute | |
parent | aaae75dc3568ba95d4db5478b1c92eec454356f4 (diff) | |
download | nova-aef4f3c40a05a35759054059a44dda8a478da443.tar.gz nova-aef4f3c40a05a35759054059a44dda8a478da443.tar.xz nova-aef4f3c40a05a35759054059a44dda8a478da443.zip |
Added conf support for security groups
Modified the way nova.compute.api.API loads the security group API.
Previously it would accept a named-parameter and if that was None, default
to SecurityGroupAPI. It still accepts a named-parameter but if that is
None, then it will attempt to load the API from CONF, and then default
to SecurityGroupAPI. The basic use-case should not be altered by these
changes.
Implements: blueprint nova-securitygroups-expansion
Change-Id: Ib252a0755f320289c3c7cb6518d55e63d3392789
Diffstat (limited to 'nova/compute')
-rw-r--r-- | nova/compute/api.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 19f5a3a26..cc02e4a82 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -81,6 +81,9 @@ compute_opts = [ cfg.StrOpt('security_group_handler', default='nova.network.sg.NullSecurityGroupHandler', help='The full class name of the security group handler class'), + cfg.StrOpt('security_group_api', + default='nova.compute.api.SecurityGroupAPI', + help='The full class name of the security API class'), ] @@ -165,7 +168,9 @@ class API(base.Base): self.network_api = network_api or network.API() self.volume_api = volume_api or volume.API() - self.security_group_api = security_group_api or SecurityGroupAPI() + self.security_group_api = (security_group_api or + importutils.import_object( + CONF.security_group_api)) self.sgh = importutils.import_object(CONF.security_group_handler) self.consoleauth_rpcapi = consoleauth_rpcapi.ConsoleAuthAPI() self.scheduler_rpcapi = scheduler_rpcapi.SchedulerAPI() |