Rename python package to freezer_ui

While current package name "disaster_recovery" is a valid slug inside
of the Horizon, when it comes to the Python package naming, it is
not conforming with Horizon Dashboard naming pattern, where
all existing dashboard packages end their names on `dashboard` or `ui`.

Current naming might break Horizon installation logic by some
common deployment tools, like OpenStack-Ansible.

To prevent that we rename the package given the opportunity, that
project is currently in Inactive state and major changes can be made to
it.

Change-Id: I965b545b6aada866ab5c6eb2279154b70bc5dff1
This commit is contained in:
Dmitriy Rabotyagov
2024-12-09 09:58:19 +01:00
parent 5c90c800a6
commit 50b6486df9
97 changed files with 83 additions and 76 deletions

View File

@@ -59,11 +59,11 @@ To install freezer dashboard for development you need to do the following::
# cd freezer-web-ui # cd freezer-web-ui
# cp freezer-web-ui/disaster_recovery/enabled/_5050_freezer.py /opt/stack/horizon/openstack_dashboard/enabled/_5050_freezer.py # cp freezer-web-ui/freezer_ui/enabled/_5050_freezer.py /opt/stack/horizon/openstack_dashboard/enabled/_5050_freezer.py
# to disable the panel just copy the following file # to disable the panel just copy the following file
# cp freezer-web-ui/disaster_recovery/enabled/_7050_freezer_remove_panel_.py /opt/stack/horizon/openstack_dashboard/enabled/_7050_freezer_remove_panel_.py # cp freezer-web-ui/freezer_ui/enabled/_7050_freezer_remove_panel_.py /opt/stack/horizon/openstack_dashboard/enabled/_7050_freezer_remove_panel_.py
# cd /opt/stack/horizon/ # cd /opt/stack/horizon/
@@ -82,11 +82,11 @@ To deploy freezer dashboard in production you need to do the following::
# cd freezer-web-ui # cd freezer-web-ui
# cp freezer-web-ui/disaster_recovery/enabled/_5050_freezer.py /opt/stack/horizon/openstack_dashboard/enabled/_5050_freezer.py # cp freezer-web-ui/freezer_ui/enabled/_5050_freezer.py /opt/stack/horizon/openstack_dashboard/enabled/_5050_freezer.py
# to disable the panel just copy the following file # to disable the panel just copy the following file
# cp freezer-web-ui/disaster_recovery/enabled/_7050_freezer_remove_panel_.py /opt/stack/horizon/openstack_dashboard/enabled/_7050_freezer_remove_panel_.py # cp freezer-web-ui/freezer_ui/enabled/_7050_freezer_remove_panel_.py /opt/stack/horizon/openstack_dashboard/enabled/_7050_freezer_remove_panel_.py
# make sure freezer is installed from source as detailed in the first step # make sure freezer is installed from source as detailed in the first step

View File

@@ -16,7 +16,7 @@ from django.utils.translation import gettext_lazy as _
import horizon import horizon
from disaster_recovery import dashboard from freezer_ui import dashboard
class ActionsPanel(horizon.Panel): class ActionsPanel(horizon.Panel):

View File

@@ -17,7 +17,7 @@ from django.utils.translation import ngettext_lazy
from horizon import tables from horizon import tables
from django.urls import reverse from django.urls import reverse
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
class DeleteAction(tables.DeleteAction): class DeleteAction(tables.DeleteAction):

View File

@@ -14,7 +14,7 @@
from django.urls import re_path from django.urls import re_path
from disaster_recovery.actions import views from freezer_ui.actions import views
urlpatterns = [ urlpatterns = [
re_path(r'^$', views.IndexView.as_view(), name='index'), re_path(r'^$', views.IndexView.as_view(), name='index'),

View File

@@ -19,11 +19,11 @@ from django.views import generic
from horizon import tables from horizon import tables
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
from disaster_recovery.actions import tables as freezer_tables from freezer_ui.actions import tables as freezer_tables
from disaster_recovery.actions.workflows import action as action_workflow from freezer_ui.actions.workflows import action as action_workflow
from disaster_recovery.utils import shield from freezer_ui.utils import shield
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):

View File

@@ -19,7 +19,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
class ActionConfigurationAction(workflows.Action): class ActionConfigurationAction(workflows.Action):

View File

@@ -19,7 +19,7 @@ from django.conf import settings
from horizon.utils.memoized import memoized # noqa from horizon.utils.memoized import memoized # noqa
from freezerclient import client as freezer_client from freezerclient import client as freezer_client
from disaster_recovery import utils from freezer_ui import utils
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)

View File

@@ -21,7 +21,7 @@ from django.views import generic
from openstack_dashboard.api.rest import utils as rest_utils from openstack_dashboard.api.rest import utils as rest_utils
from openstack_dashboard.api.rest import utils from openstack_dashboard.api.rest import utils
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
# https://github.com/tornadoweb/tornado/issues/1009 # https://github.com/tornadoweb/tornado/issues/1009

View File

@@ -18,7 +18,7 @@ URL patterns for the OpenStack Dashboard.
from django.urls import re_path from django.urls import re_path
from disaster_recovery.api.rest import rest_api from freezer_ui.api.rest import rest_api
urlpatterns = [ urlpatterns = [
re_path(r'^api/clients/$', rest_api.Clients.as_view(), re_path(r'^api/clients/$', rest_api.Clients.as_view(),

View File

@@ -16,7 +16,7 @@ from django.utils.translation import gettext_lazy as _
import horizon import horizon
from disaster_recovery import dashboard from freezer_ui import dashboard
class BackupsPanel(horizon.Panel): class BackupsPanel(horizon.Panel):

View File

@@ -20,9 +20,9 @@ from django.utils.translation import gettext_lazy as _
from horizon import tables from horizon import tables
from horizon.utils import functions as utils from horizon.utils import functions as utils
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
from disaster_recovery.utils import shield from freezer_ui.utils import shield
from disaster_recovery.utils import timestamp_to_string from freezer_ui.utils import timestamp_to_string
class Restore(tables.LinkAction): class Restore(tables.LinkAction):

View File

@@ -15,7 +15,7 @@
from django.urls import re_path from django.urls import re_path
from disaster_recovery.backups import views from freezer_ui.backups import views
urlpatterns = [ urlpatterns = [

View File

@@ -19,11 +19,11 @@ from django.views import generic
from horizon import tables from horizon import tables
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
from disaster_recovery.backups import tables as freezer_tables from freezer_ui.backups import tables as freezer_tables
from disaster_recovery.backups.workflows import restore as restore_workflow from freezer_ui.backups.workflows import restore as restore_workflow
from disaster_recovery.utils import shield from freezer_ui.utils import shield
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):

View File

@@ -19,7 +19,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
class DestinationAction(workflows.MembershipAction): class DestinationAction(workflows.MembershipAction):

View File

@@ -16,7 +16,7 @@ from django.utils.translation import gettext_lazy as _
import horizon import horizon
from disaster_recovery import dashboard from freezer_ui import dashboard
class ClientsPanel(horizon.Panel): class ClientsPanel(horizon.Panel):

View File

@@ -16,8 +16,8 @@ from django.utils.translation import ngettext_lazy
from horizon import tables from horizon import tables
from django.urls import reverse from django.urls import reverse
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
from disaster_recovery.utils import shield from freezer_ui.utils import shield
class Filter(tables.FilterAction): class Filter(tables.FilterAction):

View File

@@ -14,7 +14,7 @@
from django.urls import re_path from django.urls import re_path
from disaster_recovery.clients import views from freezer_ui.clients import views
urlpatterns = [ urlpatterns = [
re_path(r'^$', views.IndexView.as_view(), name='index'), re_path(r'^$', views.IndexView.as_view(), name='index'),

View File

@@ -17,10 +17,10 @@ from django.views import generic
from horizon import tables from horizon import tables
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
from disaster_recovery.clients import tables as freezer_tables from freezer_ui.clients import tables as freezer_tables
from disaster_recovery.utils import shield from freezer_ui.utils import shield
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):

View File

@@ -6,5 +6,5 @@ DISABLED = False
# A list of applications to be added to INSTALLED_APPS. # A list of applications to be added to INSTALLED_APPS.
ADD_INSTALLED_APPS = [ ADD_INSTALLED_APPS = [
'disaster_recovery', 'freezer_ui',
] ]

View File

@@ -14,7 +14,7 @@
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from disaster_recovery.jobs import tables from freezer_ui.jobs import tables
from horizon import browsers from horizon import browsers

View File

@@ -16,7 +16,7 @@ from django.utils.translation import gettext_lazy as _
import horizon import horizon
from disaster_recovery import dashboard from freezer_ui import dashboard
class JobsPanel(horizon.Panel): class JobsPanel(horizon.Panel):

View File

@@ -20,8 +20,8 @@ from horizon import tables
from horizon import messages from horizon import messages
from django.urls import reverse from django.urls import reverse
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
from disaster_recovery.utils import shield from freezer_ui.utils import shield
class ObjectFilterAction(tables.FilterAction): class ObjectFilterAction(tables.FilterAction):

View File

@@ -13,7 +13,7 @@
# limitations under the License. # limitations under the License.
from django.urls import re_path from django.urls import re_path
from disaster_recovery.jobs import views from freezer_ui.jobs import views
urlpatterns = [ urlpatterns = [
re_path(r'^(?P<job_id>[^/]+)?$', re_path(r'^(?P<job_id>[^/]+)?$',

View File

@@ -13,14 +13,14 @@
from horizon import browsers from horizon import browsers
from horizon import workflows from horizon import workflows
from disaster_recovery.jobs.workflows import create as configure_workflow from freezer_ui.jobs.workflows import create as configure_workflow
from disaster_recovery.jobs.workflows import update_job as update_job_workflow from freezer_ui.jobs.workflows import update_job as update_job_workflow
from disaster_recovery.jobs.workflows import update_actions as update_workflow from freezer_ui.jobs.workflows import update_actions as update_workflow
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
import disaster_recovery.jobs.browsers as project_browsers import freezer_ui.jobs.browsers as project_browsers
from disaster_recovery.utils import shield from freezer_ui.utils import shield
class JobsView(browsers.ResourceBrowserView): class JobsView(browsers.ResourceBrowserView):

View File

@@ -17,7 +17,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
class ActionsConfigurationAction(workflows.Action): class ActionsConfigurationAction(workflows.Action):

View File

@@ -21,7 +21,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
class ActionsConfigurationAction(workflows.Action): class ActionsConfigurationAction(workflows.Action):

View File

@@ -19,7 +19,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
class ActionsConfigurationAction(workflows.Action): class ActionsConfigurationAction(workflows.Action):

View File

@@ -21,7 +21,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
class InfoConfigurationAction(workflows.Action): class InfoConfigurationAction(workflows.Action):

View File

@@ -14,7 +14,7 @@
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from disaster_recovery.sessions import tables from freezer_ui.sessions import tables
from horizon import browsers from horizon import browsers

View File

@@ -17,7 +17,7 @@ from django.utils.translation import gettext_lazy as _
import horizon import horizon
from disaster_recovery import dashboard from freezer_ui import dashboard
class SessionsPanel(horizon.Panel): class SessionsPanel(horizon.Panel):

View File

@@ -18,8 +18,8 @@ from django.urls import reverse
from horizon import tables from horizon import tables
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
from disaster_recovery.utils import shield from freezer_ui.utils import shield
class ObjectFilterAction(tables.FilterAction): class ObjectFilterAction(tables.FilterAction):

View File

@@ -14,7 +14,7 @@
from django.urls import re_path from django.urls import re_path
from disaster_recovery.sessions import views from freezer_ui.sessions import views
urlpatterns = [ urlpatterns = [
re_path(r'^(?P<session_id>[^/]+)?$', re_path(r'^(?P<session_id>[^/]+)?$',

View File

@@ -15,12 +15,12 @@
from horizon import browsers from horizon import browsers
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
import disaster_recovery.sessions.browsers as project_browsers import freezer_ui.sessions.browsers as project_browsers
from disaster_recovery.sessions.workflows import attach from freezer_ui.sessions.workflows import attach
from disaster_recovery.sessions.workflows import create from freezer_ui.sessions.workflows import create
from disaster_recovery.utils import shield from freezer_ui.utils import shield
class SessionsView(browsers.ResourceBrowserView): class SessionsView(browsers.ResourceBrowserView):

View File

@@ -19,7 +19,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
class SessionConfigurationAction(workflows.Action): class SessionConfigurationAction(workflows.Action):

View File

@@ -22,7 +22,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import workflows from horizon import workflows
import disaster_recovery.api.api as freezer_api import freezer_ui.api.api as freezer_api
class SessionConfigurationAction(workflows.Action): class SessionConfigurationAction(workflows.Action):

View File

@@ -5,7 +5,7 @@ var Browser = (function () {
url += "//"; url += "//";
url += $(location).attr("host"); url += $(location).attr("host");
url += WEBROOT + 'disaster_recovery/api/'; url += WEBROOT + 'freezer_ui/api/';
return { return {
get_url : function () { get_url : function () {

View File

@@ -21,7 +21,7 @@
angular.module('hz').controller('DestinationCtrl', function ($scope, $http, $location) { angular.module('hz').controller('DestinationCtrl', function ($scope, $http, $location) {
$scope.query = ''; $scope.query = '';
$http.get($location.protocol() + "://" + $location.host() + ":" + $location.port() + "/disaster_recovery/api/clients"). $http.get($location.protocol() + "://" + $location.host() + ":" + $location.port() + "/freezer_ui/api/clients").
success(function (data) { success(function (data) {
$scope.clients = data; $scope.clients = data;
}); });

View File

@@ -14,7 +14,7 @@
from django.conf.urls import include from django.conf.urls import include
from django.urls import re_path from django.urls import re_path
import disaster_recovery.api.rest.urls as rest_urls import freezer_ui.api.rest.urls as rest_urls
urlpatterns = [ urlpatterns = [

View File

@@ -18,6 +18,6 @@ import sys
if __name__ == "__main__": if __name__ == "__main__":
os.environ.setdefault( os.environ.setdefault(
"DJANGO_SETTINGS_MODULE", "disaster_recovery.tests.settings") "DJANGO_SETTINGS_MODULE", "freezer_ui.tests.settings")
from django.core.management import execute_from_command_line # noqa from django.core.management import execute_from_command_line # noqa
execute_from_command_line(sys.argv) execute_from_command_line(sys.argv)

View File

@@ -0,0 +1,7 @@
---
prelude: >
Python package name for Freezer Horizon Dashboard has been renamed from
``disaster_recovery`` to ``freezer_ui`` in order to align with repository
naming and naming conventions for Dashboards.
This will not have any effect on URIs inside of the Horizon as well as
representation of the Dashboard in UI.

View File

@@ -57,7 +57,7 @@ root=`pwd -P`
venv=$root/.venv venv=$root/.venv
venv_env_version=$venv/environments venv_env_version=$venv/environments
with_venv=tools/with_venv.sh with_venv=tools/with_venv.sh
included_dirs="disaster_recovery" included_dirs="freezer_ui"
always_venv=0 always_venv=0
backup_env=0 backup_env=0
@@ -187,7 +187,7 @@ function warn_on_flake8_without_venv {
function run_pep8 { function run_pep8 {
echo "Running flake8 ..." echo "Running flake8 ..."
warn_on_flake8_without_venv warn_on_flake8_without_venv
DJANGO_SETTINGS_MODULE=disaster_recovery.test.settings ${command_wrapper} flake8 DJANGO_SETTINGS_MODULE=freezer_ui.test.settings ${command_wrapper} flake8
} }
function run_pep8_changed { function run_pep8_changed {
@@ -200,13 +200,13 @@ function run_pep8_changed {
files=$(git diff --name-only $base_commit | tr '\n' ' ') files=$(git diff --name-only $base_commit | tr '\n' ' ')
echo "Running flake8 on ${files}" echo "Running flake8 on ${files}"
warn_on_flake8_without_venv warn_on_flake8_without_venv
diff -u --from-file /dev/null ${files} | DJANGO_SETTINGS_MODULE=disaster_recovery.test.settings ${command_wrapper} flake8 --diff diff -u --from-file /dev/null ${files} | DJANGO_SETTINGS_MODULE=freezer_ui.test.settings ${command_wrapper} flake8 --diff
exit exit
} }
function run_sphinx { function run_sphinx {
echo "Building sphinx..." echo "Building sphinx..."
DJANGO_SETTINGS_MODULE=disaster_recovery.test.settings ${command_wrapper} python setup.py build_sphinx DJANGO_SETTINGS_MODULE=freezer_ui.test.settings ${command_wrapper} python setup.py build_sphinx
echo "Build complete." echo "Build complete."
} }
@@ -340,7 +340,7 @@ function run_tests {
fi fi
if [ $with_selenium -eq 0 -a $integration -eq 0 ]; then if [ $with_selenium -eq 0 -a $integration -eq 0 ]; then
testopts="$testopts --exclude-dir=disaster_recovery/test/integration_tests" testopts="$testopts --exclude-dir=freezer_ui/test/integration_tests"
fi fi
if [ $selenium_headless -eq 1 ]; then if [ $selenium_headless -eq 1 ]; then
@@ -361,11 +361,11 @@ function run_tests_subset {
function run_tests_all { function run_tests_all {
echo "Running Freezer Web UI tests" echo "Running Freezer Web UI tests"
export NOSE_XUNIT_FILE=disaster_recovery/nosetests.xml export NOSE_XUNIT_FILE=freezer_ui/nosetests.xml
if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then if [ "$NOSE_WITH_HTML_OUTPUT" = '1' ]; then
export NOSE_HTML_OUT_FILE='dashboard_nose_results.html' export NOSE_HTML_OUT_FILE='dashboard_nose_results.html'
fi fi
${command_wrapper} ${coverage_run} $root/manage.py test disaster_recovery --settings=disaster_recovery.test.settings $testopts ${command_wrapper} ${coverage_run} $root/manage.py test freezer_ui --settings=freezer_ui.test.settings $testopts
# get results of the openstack_dashboard tests # get results of the openstack_dashboard tests
DASHBOARD_RESULT=$? DASHBOARD_RESULT=$?
@@ -421,7 +421,7 @@ function babel_extract {
function run_makemessages { function run_makemessages {
echo -n "freezer web ui: " echo -n "freezer web ui: "
cd disaster_recovery cd freezer_ui
babel_extract django babel_extract django
FREEZER_PY_RESULT=$? FREEZER_PY_RESULT=$?
@@ -431,7 +431,7 @@ function run_makemessages {
cd .. cd ..
if [ $check_only -eq 1 ]; then if [ $check_only -eq 1 ]; then
rm disaster_recovery/locale/django*.pot rm freezer_ui/locale/django*.pot
fi fi
exit $(($FREEZER_PY_RESULT || $FREEZER_JS_RESULT)) exit $(($FREEZER_PY_RESULT || $FREEZER_JS_RESULT))

View File

@@ -32,4 +32,4 @@ keywords =
[files] [files]
packages = packages =
disaster_recovery freezer_ui

View File

@@ -38,11 +38,11 @@ commands = python setup.py test --coverage --testr-args={posargs}
[testenv:docs] [testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
setenv = DJANGO_SETTINGS_MODULE=disaster_recovery.test.settings setenv = DJANGO_SETTINGS_MODULE=freezer_ui.test.settings
commands = sphinx-build -W --keep-going -b html doc/source doc/build/html commands = sphinx-build -W --keep-going -b html doc/source doc/build/html
[testenv:pylint] [testenv:pylint]
commands = pylint --rcfile .pylintrc disaster_recovery commands = pylint --rcfile .pylintrc freezer_ui
[flake8] [flake8]
# W504 line break after binary operator # W504 line break after binary operator