Merge "Add config for visibility of cisco-policy-profile"

This commit is contained in:
Jenkins
2014-08-29 09:15:49 +00:00
committed by Gerrit Code Review
4 changed files with 112 additions and 3 deletions

View File

@@ -78,6 +78,9 @@ cisco_n1k_opts = [
help=_("N1K policy profile for network node")),
cfg.IntOpt('poll_duration', default=60,
help=_("N1K Policy profile polling duration in seconds")),
cfg.BoolOpt('restrict_policy_profiles', default=False,
help=_("Restrict the visibility of policy profiles to the "
"tenants")),
cfg.IntOpt('http_pool_size', default=4,
help=_("Number of threads to use to make HTTP requests")),
cfg.IntOpt('http_timeout', default=15,

View File

@@ -30,6 +30,7 @@ from neutron.db import models_v2
from neutron.openstack.common import log as logging
from neutron.plugins.cisco.common import cisco_constants as c_const
from neutron.plugins.cisco.common import cisco_exceptions as c_exc
from neutron.plugins.cisco.common import config as c_conf
from neutron.plugins.cisco.db import n1kv_models_v2
LOG = logging.getLogger(__name__)
@@ -1494,7 +1495,7 @@ class PolicyProfile_db_mixin(object):
profile dictionary. Only these fields will be returned
:returns: list of all policy profiles
"""
if context.is_admin:
if context.is_admin or not c_conf.CISCO_N1K.restrict_policy_profiles:
return self._get_collection(context, n1kv_models_v2.PolicyProfile,
self._make_policy_profile_dict,
filters=filters, fields=fields)