def allowed(self, request, share): share_replication_enabled = share.replication_type is not None return manila.is_replication_enabled() and share_replication_enabled
name='detail'), urls.url(r'^(?P<share_id>[^/]+)/update/$', shares_views.UpdateView.as_view(), name='update'), urls.url(r'^(?P<share_id>[^/]+)/update_metadata/$', shares_views.UpdateMetadataView.as_view(), name='update_metadata'), urls.url(r'^(?P<share_id>[^/]+)/extend/$', shares_views.ExtendView.as_view(), name='extend'), urls.url(r'^(?P<share_id>[^/]+)/revert/$', shares_views.RevertView.as_view(), name='revert'), ] if manila.is_replication_enabled(): urlpatterns.extend([ urls.url(r'^(?P<share_id>[^/]+)/create_replica/$', replica_views.CreateReplicaView.as_view(), name='create_replica'), urls.url(r'^(?P<share_id>[^/]+)/replicas/$', replica_views.ManageReplicasView.as_view(), name='manage_replicas'), urls.url(r'^replica/(?P<replica_id>[^/]+)$', replica_views.DetailReplicaView.as_view(), name='replica_detail'), urls.url(r'^replica/(?P<replica_id>[^/]+)/set_replica_as_active$', replica_views.SetReplicaAsActiveView.as_view(), name='set_replica_as_active'), ])