Merge "Do not try to show L3 agent action when enable_router is False" into stable/ocata
This commit is contained in:
commit
3ee8fdae2c
@ -10,6 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from django.conf import settings
|
||||
from django.core import urlresolvers
|
||||
from django import template
|
||||
from django.template import defaultfilters as filters
|
||||
@ -179,6 +180,9 @@ class NetworkL3AgentRoutersLinkAction(tables.LinkAction):
|
||||
verbose_name = _("View Routers")
|
||||
|
||||
def allowed(self, request, datum):
|
||||
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
|
||||
if not network_config.get('enable_router', True):
|
||||
return False
|
||||
# Determine whether this action is allowed for the current request.
|
||||
return datum.agent_type == "L3 agent"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user