def allowed(self, request, share=None): if (share and share.status.upper() == "MIGRATING" and features.is_migration_enabled()): return True return False
def allowed(self, request, share=None): if share: return (share.status.upper() == "AVAILABLE" and not getattr(share, 'has_snapshot', False) and features.is_migration_enabled()) return False
name='manage_replicas'), re_path(r'^replica/(?P<replica_id>[^/]+)$', replica_views.DetailReplicaView.as_view(), name='replica_detail'), re_path(r'^replica/(?P<replica_id>[^/]+)/resync_replica$', replica_views.ResyncReplicaView.as_view(), name='resync_replica'), re_path(r'^replica/(?P<replica_id>[^/]+)/reset_replica_status$', replica_views.ResetReplicaStatusView.as_view(), name='reset_replica_status'), re_path(r'^replica/(?P<replica_id>[^/]+)/reset_replica_state$', replica_views.ResetReplicaStateView.as_view(), name='reset_replica_state'), ]) if features.is_migration_enabled(): urlpatterns.extend([ re_path(r'^migration_start/(?P<share_id>[^/]+)$', views.MigrationStartView.as_view(), name='migration_start'), re_path(r'^migration_complete/(?P<share_id>[^/]+)$', views.MigrationCompleteView.as_view(), name='migration_complete'), re_path(r'^migration_cancel/(?P<share_id>[^/]+)$', views.MigrationCancelView.as_view(), name='migration_cancel'), re_path(r'^migration_get_progress/(?P<share_id>[^/]+)$', views.MigrationGetProgressView.as_view(), name='migration_get_progress'), ])
name='replica_detail'), urls.url( r'^replica/(?P<replica_id>[^/]+)/resync_replica$', replica_views.ResyncReplicaView.as_view(), name='resync_replica'), urls.url( r'^replica/(?P<replica_id>[^/]+)/reset_replica_status$', replica_views.ResetReplicaStatusView.as_view(), name='reset_replica_status'), urls.url( r'^replica/(?P<replica_id>[^/]+)/reset_replica_state$', replica_views.ResetReplicaStateView.as_view(), name='reset_replica_state'), ]) if features.is_migration_enabled(): urlpatterns.extend([ urls.url( r'^migration_start/(?P<share_id>[^/]+)$', views.MigrationStartView.as_view(), name='migration_start'), urls.url( r'^migration_complete/(?P<share_id>[^/]+)$', views.MigrationCompleteView.as_view(), name='migration_complete'), urls.url( r'^migration_cancel/(?P<share_id>[^/]+)$', views.MigrationCancelView.as_view(), name='migration_cancel'), urls.url( r'^migration_get_progress/(?P<share_id>[^/]+)$',