Renaming StackTask to Adjutant
* This is just a search and replace. * No functional changes. Change-Id: Id03ae0cb572df127a590e2631c3fb4888b34ac84
This commit is contained in:
parent
a0d821da47
commit
f8d53b3a12
|
@ -1,5 +1,5 @@
|
||||||
[gerrit]
|
[gerrit]
|
||||||
host=gerrit.dmz.wgtn.cat-it.co.nz
|
host=gerrit.dmz.wgtn.cat-it.co.nz
|
||||||
port=29418
|
port=29418
|
||||||
project=openstack-stacktask-ui.git
|
project=openstack-adjutant-ui.git
|
||||||
defaultbranch=master
|
defaultbranch=master
|
||||||
|
|
12
MANIFEST.in
12
MANIFEST.in
|
@ -1,8 +1,8 @@
|
||||||
include setup.py
|
include setup.py
|
||||||
|
|
||||||
recursive-include stacktask_ui/content/default/templates *
|
recursive-include adjutant_ui/content/default/templates *
|
||||||
recursive-include stacktask_ui/content/forgotpassword/templates *
|
recursive-include adjutant_ui/content/forgotpassword/templates *
|
||||||
recursive-include stacktask_ui/content/project_users/templates *
|
recursive-include adjutant_ui/content/project_users/templates *
|
||||||
recursive-include stacktask_ui/content/tasks/templates *
|
recursive-include adjutant_ui/content/tasks/templates *
|
||||||
recursive-include stacktask_ui/content/token/templates *
|
recursive-include adjutant_ui/content/token/templates *
|
||||||
recursive-include stacktask_ui/static *
|
recursive-include adjutant_ui/static *
|
||||||
|
|
20
README.rst
20
README.rst
|
@ -1,19 +1,19 @@
|
||||||
============
|
============
|
||||||
stacktask-ui
|
adjutant-ui
|
||||||
============
|
============
|
||||||
|
|
||||||
StackTask Dashboard
|
Adjutant Dashboard
|
||||||
|
|
||||||
* Free software: Apache license
|
* Free software: Apache license
|
||||||
* Source: https://github.com/catalyst/stacktask-ui
|
* Source: https://github.com/catalyst/adjutant-ui
|
||||||
|
|
||||||
Manual Installation
|
Manual Installation
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
Begin by cloning the Horizon and StackTask UI repositories::
|
Begin by cloning the Horizon and Adjutant UI repositories::
|
||||||
|
|
||||||
git clone https://github.com/openstack/horizon
|
git clone https://github.com/openstack/horizon
|
||||||
git clone https://github.com/catalyst/stacktask-ui
|
git clone https://github.com/catalyst/adjutant-ui
|
||||||
|
|
||||||
Create a virtual environment and install Horizon dependencies::
|
Create a virtual environment and install Horizon dependencies::
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ editor. You will want to customize several settings:
|
||||||
environment. (They should be correct unless you modified your
|
environment. (They should be correct unless you modified your
|
||||||
OpenStack server to change them.)
|
OpenStack server to change them.)
|
||||||
- ``OPENSTACK_REGISTRATION_URL`` should also be configured to point to
|
- ``OPENSTACK_REGISTRATION_URL`` should also be configured to point to
|
||||||
you StackTask server and version.
|
you Adjutant server and version.
|
||||||
|
|
||||||
You will also need to update the ``keystone_policy.json`` file (openstack_dashboard/conf/keystone_policy.json) in horizon with
|
You will also need to update the ``keystone_policy.json`` file (openstack_dashboard/conf/keystone_policy.json) in horizon with
|
||||||
the following lines::
|
the following lines::
|
||||||
|
@ -44,15 +44,15 @@ the following lines::
|
||||||
"project_admin_only": "rule:admin_required or rule:project_admin",
|
"project_admin_only": "rule:admin_required or rule:project_admin",
|
||||||
"identity:project_users_access": "rule:project_mod_or_admin",
|
"identity:project_users_access": "rule:project_mod_or_admin",
|
||||||
|
|
||||||
Install StackTask UI with all dependencies in your virtual environment::
|
Install Adjutant UI with all dependencies in your virtual environment::
|
||||||
|
|
||||||
tools/with_venv.sh pip install -e ../stacktask-ui/
|
tools/with_venv.sh pip install -e ../adjutant-ui/
|
||||||
|
|
||||||
And enable it in Horizon::
|
And enable it in Horizon::
|
||||||
|
|
||||||
cp ../stacktask-ui/stacktask-ui/enabled/_* openstack_dashboard/local/enabled
|
cp ../adjutant-ui/adjutant-ui/enabled/_* openstack_dashboard/local/enabled
|
||||||
|
|
||||||
To run horizon with the newly enabled StackTask UI plugin run::
|
To run horizon with the newly enabled Adjutant UI plugin run::
|
||||||
|
|
||||||
./run_tests.sh --runserver 0.0.0.0:8080
|
./run_tests.sh --runserver 0.0.0.0:8080
|
||||||
|
|
||||||
|
|
|
@ -20,5 +20,5 @@ import horizon
|
||||||
class Default(horizon.Panel):
|
class Default(horizon.Panel):
|
||||||
name = _("Default")
|
name = _("Default")
|
||||||
slug = 'default'
|
slug = 'default'
|
||||||
urls = 'stacktask_ui.content.project_users.urls'
|
urls = 'adjutant_ui.content.project_users.urls'
|
||||||
nav = False
|
nav = False
|
|
@ -20,7 +20,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from horizon import forms as hforms
|
from horizon import forms as hforms
|
||||||
from horizon.utils import functions as utils
|
from horizon.utils import functions as utils
|
||||||
|
|
||||||
from stacktask_ui.api import stacktask
|
from adjutant_ui.api import adjutant
|
||||||
|
|
||||||
# Username is ignored, use email address instead.
|
# Username is ignored, use email address instead.
|
||||||
USERNAME_IS_EMAIL = True
|
USERNAME_IS_EMAIL = True
|
||||||
|
@ -45,7 +45,7 @@ class ForgotPasswordForm(hforms.SelfHandlingForm):
|
||||||
|
|
||||||
def handle(self, request, data):
|
def handle(self, request, data):
|
||||||
try:
|
try:
|
||||||
submit_response = stacktask.forgotpassword_submit(
|
submit_response = adjutant.forgotpassword_submit(
|
||||||
request, data)
|
request, data)
|
||||||
if submit_response.ok:
|
if submit_response.ok:
|
||||||
return True
|
return True
|
|
@ -15,7 +15,7 @@
|
||||||
from django.conf.urls import patterns
|
from django.conf.urls import patterns
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
|
||||||
from stacktask_ui.content.forgot_password import views
|
from adjutant_ui.content.forgot_password import views
|
||||||
|
|
||||||
# NOTE(adriant): These urls are registered in the project_users urls.py file.
|
# NOTE(adriant): These urls are registered in the project_users urls.py file.
|
||||||
urlpatterns = patterns(
|
urlpatterns = patterns(
|
|
@ -16,7 +16,7 @@ from django.shortcuts import render
|
||||||
|
|
||||||
from horizon import forms
|
from horizon import forms
|
||||||
|
|
||||||
from stacktask_ui.content.forgot_password import forms as fp_forms
|
from adjutant_ui.content.forgot_password import forms as fp_forms
|
||||||
|
|
||||||
|
|
||||||
class ForgotPasswordView(forms.ModalFormView):
|
class ForgotPasswordView(forms.ModalFormView):
|
|
@ -20,8 +20,8 @@ from horizon import exceptions
|
||||||
from horizon import forms
|
from horizon import forms
|
||||||
from horizon import messages
|
from horizon import messages
|
||||||
|
|
||||||
from stacktask_ui.api import stacktask
|
from adjutant_ui.api import adjutant
|
||||||
from stacktask_ui.content.project_users import utils
|
from adjutant_ui.content.project_users import utils
|
||||||
|
|
||||||
|
|
||||||
def get_role_choices(request):
|
def get_role_choices(request):
|
||||||
|
@ -30,7 +30,7 @@ def get_role_choices(request):
|
||||||
Returns a list of sorted 2-ary tuples containing the roles the current
|
Returns a list of sorted 2-ary tuples containing the roles the current
|
||||||
user can manage.
|
user can manage.
|
||||||
"""
|
"""
|
||||||
role_names = stacktask.valid_role_names_get(request)
|
role_names = adjutant.valid_role_names_get(request)
|
||||||
role_tuples = [(r, utils.get_role_text(r)) for r in role_names]
|
role_tuples = [(r, utils.get_role_text(r)) for r in role_names]
|
||||||
role_tuples = sorted(role_tuples, key=lambda role: role[1])
|
role_tuples = sorted(role_tuples, key=lambda role: role[1])
|
||||||
return role_tuples
|
return role_tuples
|
||||||
|
@ -56,7 +56,7 @@ class InviteUserForm(forms.SelfHandlingForm):
|
||||||
|
|
||||||
def handle(self, request, data):
|
def handle(self, request, data):
|
||||||
try:
|
try:
|
||||||
response = stacktask.user_invite(request, data)
|
response = adjutant.user_invite(request, data)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
messages.success(request, _('Invited user successfully.'))
|
messages.success(request, _('Invited user successfully.'))
|
||||||
else:
|
else:
|
||||||
|
@ -91,10 +91,10 @@ class UpdateUserForm(forms.SelfHandlingForm):
|
||||||
# Submit each list to the api (add first?)
|
# Submit each list to the api (add first?)
|
||||||
try:
|
try:
|
||||||
user_id = data['id']
|
user_id = data['id']
|
||||||
current_user = stacktask.user_get(request, user_id)
|
current_user = adjutant.user_get(request, user_id)
|
||||||
current_roles = set(current_user['roles'])
|
current_roles = set(current_user['roles'])
|
||||||
managable_roles = set(
|
managable_roles = set(
|
||||||
stacktask.valid_role_names_get(request))
|
adjutant.valid_role_names_get(request))
|
||||||
current_managable_roles = current_roles & managable_roles
|
current_managable_roles = current_roles & managable_roles
|
||||||
desired_roles = set(data['roles'])
|
desired_roles = set(data['roles'])
|
||||||
roles_added = list(desired_roles - current_managable_roles)
|
roles_added = list(desired_roles - current_managable_roles)
|
||||||
|
@ -103,7 +103,7 @@ class UpdateUserForm(forms.SelfHandlingForm):
|
||||||
# Remove roles from user
|
# Remove roles from user
|
||||||
remove_status = 200
|
remove_status = 200
|
||||||
if len(roles_removed) > 0:
|
if len(roles_removed) > 0:
|
||||||
remove_response = stacktask.user_roles_remove(
|
remove_response = adjutant.user_roles_remove(
|
||||||
request,
|
request,
|
||||||
user_id,
|
user_id,
|
||||||
roles_removed)
|
roles_removed)
|
||||||
|
@ -115,7 +115,7 @@ class UpdateUserForm(forms.SelfHandlingForm):
|
||||||
# Add new roles
|
# Add new roles
|
||||||
added_status = 200
|
added_status = 200
|
||||||
if len(roles_added) > 0:
|
if len(roles_added) > 0:
|
||||||
added_response = stacktask.user_roles_add(
|
added_response = adjutant.user_roles_add(
|
||||||
request,
|
request,
|
||||||
user_id,
|
user_id,
|
||||||
roles_added)
|
roles_added)
|
|
@ -20,8 +20,8 @@ from django.utils.translation import ungettext_lazy
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
|
|
||||||
from stacktask_ui.api import stacktask
|
from adjutant_ui.api import adjutant
|
||||||
from stacktask_ui.content.project_users import utils
|
from adjutant_ui.content.project_users import utils
|
||||||
|
|
||||||
|
|
||||||
class InviteUser(tables.LinkAction):
|
class InviteUser(tables.LinkAction):
|
||||||
|
@ -65,7 +65,7 @@ class ResendInvitation(tables.BatchAction):
|
||||||
|
|
||||||
def action(self, request, datum_id):
|
def action(self, request, datum_id):
|
||||||
user = self.table.get_object_by_id(datum_id)
|
user = self.table.get_object_by_id(datum_id)
|
||||||
stacktask.user_invitation_resend(request, user.id)
|
adjutant.user_invitation_resend(request, user.id)
|
||||||
|
|
||||||
|
|
||||||
class UpdateUser(tables.LinkAction):
|
class UpdateUser(tables.LinkAction):
|
||||||
|
@ -108,11 +108,11 @@ class RevokeUser(tables.DeleteAction):
|
||||||
result = None
|
result = None
|
||||||
if user.cohort == 'Invited':
|
if user.cohort == 'Invited':
|
||||||
# Revoke invite for the user
|
# Revoke invite for the user
|
||||||
result = stacktask.user_revoke(request, user.id)
|
result = adjutant.user_revoke(request, user.id)
|
||||||
else:
|
else:
|
||||||
# Revoke all roles from the user.
|
# Revoke all roles from the user.
|
||||||
# That'll get them out of our project; they keep their account.
|
# That'll get them out of our project; they keep their account.
|
||||||
result = stacktask.user_roles_remove(
|
result = adjutant.user_roles_remove(
|
||||||
request, user.id, user.roles)
|
request, user.id, user.roles)
|
||||||
if not result or result.status_code != 200:
|
if not result or result.status_code != 200:
|
||||||
exception = exceptions.NotAvailable()
|
exception = exceptions.NotAvailable()
|
||||||
|
@ -124,7 +124,7 @@ class UpdateUserRow(tables.Row):
|
||||||
ajax = True
|
ajax = True
|
||||||
|
|
||||||
def get_data(self, request, user_id):
|
def get_data(self, request, user_id):
|
||||||
user = stacktask.user_get(request, user_id)
|
user = adjutant.user_get(request, user_id)
|
||||||
return user
|
return user
|
||||||
|
|
||||||
def load_cells(self, user=None):
|
def load_cells(self, user=None):
|
|
@ -15,7 +15,7 @@
|
||||||
from django.conf.urls import patterns
|
from django.conf.urls import patterns
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
|
||||||
from stacktask_ui.content.project_users import views
|
from adjutant_ui.content.project_users import views
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = patterns(
|
urlpatterns = patterns(
|
|
@ -21,11 +21,11 @@ from horizon import forms
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
from horizon.utils import memoized
|
from horizon.utils import memoized
|
||||||
|
|
||||||
from stacktask_ui.content.project_users import tables as users_tables
|
from adjutant_ui.content.project_users import tables as users_tables
|
||||||
|
|
||||||
from stacktask_ui.content.project_users import forms as users_forms
|
from adjutant_ui.content.project_users import forms as users_forms
|
||||||
|
|
||||||
from stacktask_ui.api import stacktask
|
from adjutant_ui.api import adjutant
|
||||||
|
|
||||||
|
|
||||||
class InviteUserView(forms.ModalFormView):
|
class InviteUserView(forms.ModalFormView):
|
||||||
|
@ -54,7 +54,7 @@ class UpdateUserView(forms.ModalFormView):
|
||||||
@memoized.memoized_method
|
@memoized.memoized_method
|
||||||
def get_object(self):
|
def get_object(self):
|
||||||
try:
|
try:
|
||||||
return stacktask.user_get(self.request,
|
return adjutant.user_get(self.request,
|
||||||
self.kwargs['user_id'])
|
self.kwargs['user_id'])
|
||||||
except Exception:
|
except Exception:
|
||||||
msg = _('Unable to retrieve user.')
|
msg = _('Unable to retrieve user.')
|
||||||
|
@ -84,7 +84,7 @@ class UsersView(tables.DataTableView):
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
try:
|
try:
|
||||||
return stacktask.user_list(self.request)
|
return adjutant.user_list(self.request)
|
||||||
except Exception:
|
except Exception:
|
||||||
exceptions.handle(self.request, _('Failed to list users.'))
|
exceptions.handle(self.request, _('Failed to list users.'))
|
||||||
return []
|
return []
|
|
@ -19,7 +19,7 @@ from horizon import messages
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from stacktask_ui.api import stacktask
|
from adjutant_ui.api import adjutant
|
||||||
|
|
||||||
|
|
||||||
class UpdateTaskForm(forms.SelfHandlingForm):
|
class UpdateTaskForm(forms.SelfHandlingForm):
|
||||||
|
@ -41,7 +41,7 @@ class UpdateTaskForm(forms.SelfHandlingForm):
|
||||||
def handle(self, request, data):
|
def handle(self, request, data):
|
||||||
task_id = self.cleaned_data.pop('task_id')
|
task_id = self.cleaned_data.pop('task_id')
|
||||||
try:
|
try:
|
||||||
response = stacktask.task_update(
|
response = adjutant.task_update(
|
||||||
request, task_id, data['task_data'])
|
request, task_id, data['task_data'])
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
messages.success(request, _('Updated task successfully.'))
|
messages.success(request, _('Updated task successfully.'))
|
|
@ -18,7 +18,7 @@ from django.utils.translation import ungettext_lazy
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon import tables
|
from horizon import tables
|
||||||
|
|
||||||
from stacktask_ui.api import stacktask
|
from adjutant_ui.api import adjutant
|
||||||
|
|
||||||
|
|
||||||
class CancelTask(tables.DeleteAction):
|
class CancelTask(tables.DeleteAction):
|
||||||
|
@ -41,7 +41,7 @@ class CancelTask(tables.DeleteAction):
|
||||||
)
|
)
|
||||||
|
|
||||||
def delete(self, request, obj_id):
|
def delete(self, request, obj_id):
|
||||||
result = stacktask.task_cancel(request, obj_id)
|
result = adjutant.task_cancel(request, obj_id)
|
||||||
if not result or result.status_code != 200:
|
if not result or result.status_code != 200:
|
||||||
exception = exceptions.NotAvailable()
|
exception = exceptions.NotAvailable()
|
||||||
exception._safe_message = False
|
exception._safe_message = False
|
||||||
|
@ -75,7 +75,7 @@ class ApproveTask(tables.BatchAction):
|
||||||
)
|
)
|
||||||
|
|
||||||
def action(self, request, obj_id):
|
def action(self, request, obj_id):
|
||||||
result = stacktask.task_approve(request, obj_id)
|
result = adjutant.task_approve(request, obj_id)
|
||||||
if not result or result.status_code != 200:
|
if not result or result.status_code != 200:
|
||||||
exception = exceptions.NotAvailable()
|
exception = exceptions.NotAvailable()
|
||||||
exception._safe_message = False
|
exception._safe_message = False
|
|
@ -17,8 +17,8 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
from horizon import tabs
|
from horizon import tabs
|
||||||
|
|
||||||
from stacktask_ui.content.tasks import tables as task_tables
|
from adjutant_ui.content.tasks import tables as task_tables
|
||||||
from stacktask_ui.api import stacktask
|
from adjutant_ui.api import adjutant
|
||||||
|
|
||||||
|
|
||||||
class ActiveTaskListTab(tabs.TableTab):
|
class ActiveTaskListTab(tabs.TableTab):
|
||||||
|
@ -37,7 +37,7 @@ class ActiveTaskListTab(tabs.TableTab):
|
||||||
marker = self.request.GET.get(
|
marker = self.request.GET.get(
|
||||||
self.table_classes[0]._meta.pagination_param, 1)
|
self.table_classes[0]._meta.pagination_param, 1)
|
||||||
try:
|
try:
|
||||||
tasks, self._prev, self._more = stacktask.task_list(
|
tasks, self._prev, self._more = adjutant.task_list(
|
||||||
self.request, filters=self.filters, page=marker)
|
self.request, filters=self.filters, page=marker)
|
||||||
except Exception:
|
except Exception:
|
||||||
exceptions.handle(self.request, _('Failed to list tasks.'))
|
exceptions.handle(self.request, _('Failed to list tasks.'))
|
|
@ -15,7 +15,7 @@
|
||||||
from django.conf.urls import patterns
|
from django.conf.urls import patterns
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
|
||||||
from stacktask_ui.content.tasks import views
|
from adjutant_ui.content.tasks import views
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = patterns(
|
urlpatterns = patterns(
|
|
@ -21,10 +21,10 @@ from horizon import tabs
|
||||||
|
|
||||||
from horizon.utils import memoized
|
from horizon.utils import memoized
|
||||||
|
|
||||||
from stacktask_ui.content.tasks import tables as task_tables
|
from adjutant_ui.content.tasks import tables as task_tables
|
||||||
from stacktask_ui.content.tasks import forms as task_forms
|
from adjutant_ui.content.tasks import forms as task_forms
|
||||||
from stacktask_ui.content.tasks import tabs as task_tabs
|
from adjutant_ui.content.tasks import tabs as task_tabs
|
||||||
from stacktask_ui.api import stacktask
|
from adjutant_ui.api import adjutant
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class TaskDetailView(tabs.TabView):
|
||||||
context["task"] = task
|
context["task"] = task
|
||||||
context["url"] = reverse(self.redirect_url)
|
context["url"] = reverse(self.redirect_url)
|
||||||
context["actions"] = self._get_actions(
|
context["actions"] = self._get_actions(
|
||||||
stacktask.task_obj_get(self.request, task=task))
|
adjutant.task_obj_get(self.request, task=task))
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def _get_actions(self, task):
|
def _get_actions(self, task):
|
||||||
|
@ -57,7 +57,7 @@ class TaskDetailView(tabs.TabView):
|
||||||
|
|
||||||
@memoized.memoized_method
|
@memoized.memoized_method
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
return stacktask.task_get(self.request, self.kwargs['task_id']).json()
|
return adjutant.task_get(self.request, self.kwargs['task_id']).json()
|
||||||
|
|
||||||
def get_tabs(self, request, *args, **kwargs):
|
def get_tabs(self, request, *args, **kwargs):
|
||||||
task = self.get_data()
|
task = self.get_data()
|
||||||
|
@ -82,8 +82,8 @@ class UpdateTaskView(forms.ModalFormView):
|
||||||
@memoized.memoized_method
|
@memoized.memoized_method
|
||||||
def get_object(self):
|
def get_object(self):
|
||||||
try:
|
try:
|
||||||
return stacktask.task_get(self.request,
|
return adjutant.task_get(self.request,
|
||||||
self.kwargs['task_id']).json()
|
self.kwargs['task_id']).json()
|
||||||
except Exception:
|
except Exception:
|
||||||
msg = _('Unable to retrieve user.')
|
msg = _('Unable to retrieve user.')
|
||||||
url = reverse('horizon:management:tasks:index')
|
url = reverse('horizon:management:tasks:index')
|
|
@ -20,5 +20,5 @@ import horizon
|
||||||
class TokenPanel(horizon.Panel):
|
class TokenPanel(horizon.Panel):
|
||||||
name = _('Token')
|
name = _('Token')
|
||||||
slug = 'token'
|
slug = 'token'
|
||||||
urls = 'stacktask_ui.content.token.urls'
|
urls = 'adjutant_ui.content.token.urls'
|
||||||
nav = False
|
nav = False
|
|
@ -16,7 +16,7 @@
|
||||||
from django.conf.urls import patterns
|
from django.conf.urls import patterns
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
|
||||||
from stacktask_ui.content.token import views
|
from adjutant_ui.content.token import views
|
||||||
|
|
||||||
urlpatterns = patterns(
|
urlpatterns = patterns(
|
||||||
'',
|
'',
|
|
@ -21,8 +21,8 @@ from horizon import exceptions
|
||||||
from horizon import forms
|
from horizon import forms
|
||||||
from horizon.utils import functions as utils
|
from horizon.utils import functions as utils
|
||||||
|
|
||||||
from stacktask_ui.api import stacktask
|
from adjutant_ui.api import adjutant
|
||||||
from stacktask_ui.content.token import forms as token_forms
|
from adjutant_ui.content.token import forms as token_forms
|
||||||
|
|
||||||
|
|
||||||
def _logout_msg_response(request, msg):
|
def _logout_msg_response(request, msg):
|
||||||
|
@ -42,7 +42,7 @@ def submit_token_router(request, *args, **kwargs):
|
||||||
|
|
||||||
# Get details of the token
|
# Get details of the token
|
||||||
token_uuid = kwargs['token']
|
token_uuid = kwargs['token']
|
||||||
token = stacktask.token_get(request, token_uuid, {})
|
token = adjutant.token_get(request, token_uuid, {})
|
||||||
if not token or token.status_code != 200:
|
if not token or token.status_code != 200:
|
||||||
msg = _("Invalid token. Please request another.")
|
msg = _("Invalid token. Please request another.")
|
||||||
return _logout_msg_response(request, msg)
|
return _logout_msg_response(request, msg)
|
||||||
|
@ -76,9 +76,9 @@ class SubmitTokenPasswordView(forms.ModalFormView):
|
||||||
'password': form.cleaned_data['new_password']
|
'password': form.cleaned_data['new_password']
|
||||||
}
|
}
|
||||||
token_uuid = self.kwargs['token']
|
token_uuid = self.kwargs['token']
|
||||||
token_response = stacktask.token_submit(form.request,
|
token_response = adjutant.token_submit(form.request,
|
||||||
token_uuid,
|
token_uuid,
|
||||||
parameters)
|
parameters)
|
||||||
|
|
||||||
if token_response.ok:
|
if token_response.ok:
|
||||||
msg = _("Password successfully set. Please log in to continue.")
|
msg = _("Password successfully set. Please log in to continue.")
|
||||||
|
@ -115,9 +115,9 @@ class SubmitTokenConfirmView(forms.ModalFormView):
|
||||||
parameters = {
|
parameters = {
|
||||||
'confirm': True
|
'confirm': True
|
||||||
}
|
}
|
||||||
token_response = stacktask.token_submit(form.request,
|
token_response = adjutant.token_submit(form.request,
|
||||||
token_uuid,
|
token_uuid,
|
||||||
parameters)
|
parameters)
|
||||||
|
|
||||||
if token_response.ok:
|
if token_response.ok:
|
||||||
msg = _("Welcome to the project! Please log in to continue.")
|
msg = _("Welcome to the project! Please log in to continue.")
|
|
@ -16,7 +16,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
import horizon
|
import horizon
|
||||||
|
|
||||||
from stacktask_ui.content.forgot_password import panel
|
from adjutant_ui.content.forgot_password import panel
|
||||||
|
|
||||||
|
|
||||||
class ForgotPasswordDashboard(horizon.Dashboard):
|
class ForgotPasswordDashboard(horizon.Dashboard):
|
|
@ -16,7 +16,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
import horizon
|
import horizon
|
||||||
|
|
||||||
from stacktask_ui.content.default import panel
|
from adjutant_ui.content.default import panel
|
||||||
|
|
||||||
|
|
||||||
class ManagementDashboard(horizon.Dashboard):
|
class ManagementDashboard(horizon.Dashboard):
|
|
@ -16,7 +16,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
import horizon
|
import horizon
|
||||||
|
|
||||||
from stacktask_ui.content.token import panel
|
from adjutant_ui.content.token import panel
|
||||||
|
|
||||||
|
|
||||||
class TokenDashboard(horizon.Dashboard):
|
class TokenDashboard(horizon.Dashboard):
|
|
@ -3,5 +3,5 @@ DASHBOARD = 'management'
|
||||||
|
|
||||||
# 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 = [
|
||||||
'stacktask_ui.dashboards.management'
|
'adjutant_ui.dashboards.management'
|
||||||
]
|
]
|
|
@ -1,8 +1,8 @@
|
||||||
# Making use of this to make a generic enabled file
|
# Making use of this to make a generic enabled file
|
||||||
# to load base stacktask-ui content.
|
# to load base adjutant-ui content.
|
||||||
FEATURE = "stacktask-ui-base"
|
FEATURE = "adjutant-ui-base"
|
||||||
|
|
||||||
# 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 = [
|
||||||
'stacktask_ui'
|
'adjutant_ui'
|
||||||
]
|
]
|
|
@ -3,6 +3,6 @@ DASHBOARD = 'token'
|
||||||
|
|
||||||
# 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 = [
|
||||||
'stacktask_ui.dashboards.token_dash',
|
'adjutant_ui.dashboards.token_dash',
|
||||||
'stacktask_ui.content.token',
|
'adjutant_ui.content.token',
|
||||||
]
|
]
|
|
@ -3,7 +3,7 @@ DASHBOARD = 'forgot_password'
|
||||||
|
|
||||||
# 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 = [
|
||||||
'stacktask_ui.dashboards.forgot_password_dash',
|
'adjutant_ui.dashboards.forgot_password_dash',
|
||||||
'stacktask_ui.content.forgot_password',
|
'adjutant_ui.content.forgot_password',
|
||||||
'overextends',
|
'overextends',
|
||||||
]
|
]
|
|
@ -6,4 +6,4 @@ PANEL_DASHBOARD = 'management'
|
||||||
PANEL_GROUP = 'access_control'
|
PANEL_GROUP = 'access_control'
|
||||||
|
|
||||||
# Python panel class of the PANEL to be added.
|
# Python panel class of the PANEL to be added.
|
||||||
ADD_PANEL = 'stacktask_ui.content.project_users.panel.ProjectUsers'
|
ADD_PANEL = 'adjutant_ui.content.project_users.panel.ProjectUsers'
|
|
@ -6,8 +6,8 @@ PANEL_DASHBOARD = 'management'
|
||||||
PANEL_GROUP = 'default'
|
PANEL_GROUP = 'default'
|
||||||
|
|
||||||
# Python panel class of the PANEL to be added.
|
# Python panel class of the PANEL to be added.
|
||||||
ADD_PANEL = 'stacktask_ui.content.tasks.panel.TaskList'
|
ADD_PANEL = 'adjutant_ui.content.tasks.panel.TaskList'
|
||||||
|
|
||||||
ADD_INSTALLED_APPS = [
|
ADD_INSTALLED_APPS = [
|
||||||
'stacktask_ui.content.tasks'
|
'adjutant_ui.content.tasks'
|
||||||
]
|
]
|
|
@ -14,7 +14,7 @@ import mock
|
||||||
|
|
||||||
from openstack_dashboard.test.test_data import utils
|
from openstack_dashboard.test.test_data import utils
|
||||||
|
|
||||||
from stacktask_ui.test import test_data
|
from adjutant_ui.test import test_data
|
||||||
|
|
||||||
TEST = utils.TestData(test_data.data)
|
TEST = utils.TestData(test_data.data)
|
||||||
|
|
|
@ -14,7 +14,7 @@ from openstack_dashboard.test import helpers
|
||||||
|
|
||||||
|
|
||||||
class APITestCase(helpers.APITestCase):
|
class APITestCase(helpers.APITestCase):
|
||||||
"""Extends the base Horizon APITestCase for stacktaskclient"""
|
"""Extends the base Horizon APITestCase for adjutantclient"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(APITestCase, self).setUp()
|
super(APITestCase, self).setUp()
|
|
@ -14,11 +14,11 @@
|
||||||
from horizon.test.settings import * # noqa
|
from horizon.test.settings import * # noqa
|
||||||
from openstack_dashboard.test.settings import * # noqa
|
from openstack_dashboard.test.settings import * # noqa
|
||||||
|
|
||||||
# Update the dashboards with stacktask_ui
|
# Update the dashboards with adjutant_ui
|
||||||
import openstack_dashboard.enabled
|
import openstack_dashboard.enabled
|
||||||
from openstack_dashboard.utils import settings
|
from openstack_dashboard.utils import settings
|
||||||
|
|
||||||
import stacktask_ui.enabled
|
import adjutant_ui.enabled
|
||||||
|
|
||||||
# pop these keys to avoid log warnings about deprecation
|
# pop these keys to avoid log warnings about deprecation
|
||||||
# update_dashboards will populate them anyway
|
# update_dashboards will populate them anyway
|
||||||
|
@ -27,7 +27,7 @@ HORIZON_CONFIG.pop('default_dashboard', None)
|
||||||
|
|
||||||
settings.update_dashboards(
|
settings.update_dashboards(
|
||||||
[
|
[
|
||||||
stacktask_ui.enabled,
|
adjutant_ui.enabled,
|
||||||
openstack_dashboard.enabled,
|
openstack_dashboard.enabled,
|
||||||
],
|
],
|
||||||
HORIZON_CONFIG,
|
HORIZON_CONFIG,
|
|
@ -12,4 +12,4 @@
|
||||||
|
|
||||||
import pbr.version
|
import pbr.version
|
||||||
|
|
||||||
version_info = pbr.version.VersionInfo('stacktask-ui')
|
version_info = pbr.version.VersionInfo('adjutant-ui')
|
|
@ -37,8 +37,8 @@ sys.path.insert(0, ROOT)
|
||||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
|
||||||
'openstack_dashboard.test.settings')
|
'openstack_dashboard.test.settings')
|
||||||
|
|
||||||
from stacktask_ui \
|
from adjutant_ui \
|
||||||
import version as stacktask_ui_ver
|
import version as adjutant_ui_ver
|
||||||
|
|
||||||
|
|
||||||
def write_autodoc_index():
|
def write_autodoc_index():
|
||||||
|
@ -67,7 +67,7 @@ def write_autodoc_index():
|
||||||
return modlist
|
return modlist
|
||||||
|
|
||||||
RSTDIR = os.path.abspath(os.path.join(BASE_DIR, "sourcecode"))
|
RSTDIR = os.path.abspath(os.path.join(BASE_DIR, "sourcecode"))
|
||||||
SRCS = [('stacktask_ui_ver', ROOT), ]
|
SRCS = [('adjutant_ui_ver', ROOT), ]
|
||||||
|
|
||||||
EXCLUDED_MODULES = ()
|
EXCLUDED_MODULES = ()
|
||||||
CURRENT_SOURCES = {}
|
CURRENT_SOURCES = {}
|
||||||
|
@ -183,7 +183,7 @@ source_suffix = '.rst'
|
||||||
master_doc = 'index'
|
master_doc = 'index'
|
||||||
|
|
||||||
# General information about the project.
|
# General information about the project.
|
||||||
project = u'StackTask UI'
|
project = u'Adjutant UI'
|
||||||
copyright = u'2017, Catalyst IT Ltd'
|
copyright = u'2017, Catalyst IT Ltd'
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
|
@ -191,9 +191,9 @@ copyright = u'2017, Catalyst IT Ltd'
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = stacktask_ui_ver.version_info.version_string()
|
version = adjutant_ui_ver.version_info.version_string()
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = stacktask_ui_ver.version_info.release_string()
|
release = adjutant_ui_ver.version_info.release_string()
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
@ -368,8 +368,8 @@ latex_documents = [
|
||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('index', u'StackTask UI Documentation',
|
('index', u'Adjutant UI Documentation',
|
||||||
'Documentation for the StackTask UI plugin to the OpenStack\
|
'Documentation for the Adjutant UI plugin to the OpenStack\
|
||||||
Dashboard (Horizon)',
|
Dashboard (Horizon)',
|
||||||
[u'OpenStack'], 1)
|
[u'OpenStack'], 1)
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
============
|
============
|
||||||
stacktask-ui
|
adjutant-ui
|
||||||
============
|
============
|
||||||
|
|
||||||
StackTask Dashboard
|
Adjutant Dashboard
|
||||||
|
|
||||||
* Free software: Apache license
|
* Free software: Apache license
|
||||||
* Source: https://github.com/catalyst/stacktask-ui
|
* Source: https://github.com/catalyst/adjutant-ui
|
||||||
|
|
||||||
Installation instructions
|
Installation instructions
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
Begin by cloning the Horizon and StackTask UI repositories::
|
Begin by cloning the Horizon and Adjutant UI repositories::
|
||||||
|
|
||||||
git clone https://github.com/openstack/horizon
|
git clone https://github.com/openstack/horizon
|
||||||
git clone https://github.com/catalyst/stacktask-ui
|
git clone https://github.com/catalyst/adjutant-ui
|
||||||
|
|
||||||
Create a virtual environment and install Horizon dependencies::
|
Create a virtual environment and install Horizon dependencies::
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ editor. You will want to customize several settings:
|
||||||
environment. (They should be correct unless you modified your
|
environment. (They should be correct unless you modified your
|
||||||
OpenStack server to change them.)
|
OpenStack server to change them.)
|
||||||
- ``OPENSTACK_REGISTRATION_URL`` should also be configured to point to
|
- ``OPENSTACK_REGISTRATION_URL`` should also be configured to point to
|
||||||
you StackTask server and version.
|
you Adjutant server and version.
|
||||||
|
|
||||||
You will also need to update the ``keystone_policy.json`` file in horizon with
|
You will also need to update the ``keystone_policy.json`` file in horizon with
|
||||||
the following lines::
|
the following lines::
|
||||||
|
@ -44,13 +44,13 @@ the following lines::
|
||||||
"project_admin_only": "rule:admin_required or rule:project_admin",
|
"project_admin_only": "rule:admin_required or rule:project_admin",
|
||||||
"identity:project_users_access": "rule:project_mod_or_admin",
|
"identity:project_users_access": "rule:project_mod_or_admin",
|
||||||
|
|
||||||
Install StackTask UI with all dependencies in your virtual environment::
|
Install Adjutant UI with all dependencies in your virtual environment::
|
||||||
|
|
||||||
tools/with_venv.sh pip install -e ../stacktask-ui/
|
tools/with_venv.sh pip install -e ../adjutant-ui/
|
||||||
|
|
||||||
And enable it in Horizon::
|
And enable it in Horizon::
|
||||||
|
|
||||||
cp ../stacktask-ui/enabled/ openstack_dashboard/local/enabled
|
cp ../adjutant-ui/enabled/ openstack_dashboard/local/enabled
|
||||||
|
|
||||||
Release Notes
|
Release Notes
|
||||||
=============
|
=============
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
StackTask UI 0.1.1
|
Adjutant UI 0.1.1
|
||||||
===============
|
===============
|
||||||
|
|
22
run_tests.sh
22
run_tests.sh
|
@ -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="stacktask_ui"
|
included_dirs="adjutant_ui"
|
||||||
|
|
||||||
always_venv=0
|
always_venv=0
|
||||||
backup_env=0
|
backup_env=0
|
||||||
|
@ -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=stacktask_ui/test/integration_tests"
|
testopts="$testopts --exclude-dir=adjutant_ui/test/integration_tests"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $selenium_headless -eq 1 ]; then
|
if [ $selenium_headless -eq 1 ]; then
|
||||||
|
@ -360,12 +360,12 @@ function run_tests_subset {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_tests_all {
|
function run_tests_all {
|
||||||
echo "Running StackTask UI tests"
|
echo "Running Adjutant UI tests"
|
||||||
export NOSE_XUNIT_FILE=stacktask_ui/nosetests.xml
|
export NOSE_XUNIT_FILE=adjutant_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 stacktask_ui --settings=openstack_dashboard.test.settings $testopts
|
${command_wrapper} ${coverage_run} $root/manage.py test adjutant_ui --settings=openstack_dashboard.test.settings $testopts
|
||||||
# get results of the openstack_dashboard tests
|
# get results of the openstack_dashboard tests
|
||||||
DASHBOARD_RESULT=$?
|
DASHBOARD_RESULT=$?
|
||||||
|
|
||||||
|
@ -420,21 +420,21 @@ function babel_extract {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_makemessages {
|
function run_makemessages {
|
||||||
echo -n "stacktask ui: "
|
echo -n "adjutant ui: "
|
||||||
cd
|
cd
|
||||||
babel_extract django
|
babel_extract django
|
||||||
STACKTASK_PY_RESULT=$?
|
ADJUTANT_PY_RESULT=$?
|
||||||
|
|
||||||
echo -n "stacktask ui javascript: "
|
echo -n "adjutant ui javascript: "
|
||||||
babel_extract djangojs
|
babel_extract djangojs
|
||||||
STACKTASK_JS_RESULT=$?
|
ADJUTANT_JS_RESULT=$?
|
||||||
|
|
||||||
cd ../
|
cd ../
|
||||||
if [ $check_only -eq 1 ]; then
|
if [ $check_only -eq 1 ]; then
|
||||||
rm -f stacktask_ui/locale/django*.pot
|
rm -f adjutant_ui/locale/django*.pot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit $(($STACKTASK_PY_RESULT || $STACKTASK_JS_RESULT))
|
exit $(($ADJUTANT_PY_RESULT || $ADJUTANT_JS_RESULT))
|
||||||
}
|
}
|
||||||
|
|
||||||
function run_compilemessages {
|
function run_compilemessages {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = stacktask-ui
|
name = adjutant-ui
|
||||||
summary = StackTask User Interface
|
summary = Adjutant User Interface
|
||||||
description-file =
|
description-file =
|
||||||
README.rst
|
README.rst
|
||||||
author = Adrian Turjak
|
author = Adrian Turjak
|
||||||
author-email = adriant@catalyst.net.nz
|
author-email = adriant@catalyst.net.nz
|
||||||
home-page = https://github.com/catalyst/stacktask-ui
|
home-page = https://github.com/catalyst/adjutant-ui
|
||||||
classifier =
|
classifier =
|
||||||
Environment :: OpenStack
|
Environment :: OpenStack
|
||||||
Framework :: Django
|
Framework :: Django
|
||||||
|
@ -21,7 +21,7 @@ classifier =
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
packages =
|
packages =
|
||||||
stacktask_ui
|
adjutant_ui
|
||||||
|
|
||||||
[build_sphinx]
|
[build_sphinx]
|
||||||
all_files = 1
|
all_files = 1
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -11,7 +11,7 @@ setenv = VIRTUAL_ENV={envdir}
|
||||||
NOSE_OPENSTACK_RED=0.05
|
NOSE_OPENSTACK_RED=0.05
|
||||||
NOSE_OPENSTACK_YELLOW=0.025
|
NOSE_OPENSTACK_YELLOW=0.025
|
||||||
NOSE_OPENSTACK_SHOW_ELAPSED=1
|
NOSE_OPENSTACK_SHOW_ELAPSED=1
|
||||||
DJANGO_SETTINGS_MODULE=stacktask_ui.test.settings
|
DJANGO_SETTINGS_MODULE=adjutant_ui.test.settings
|
||||||
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -U {opts} {packages}
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -U {opts} {packages}
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
@ -26,7 +26,7 @@ commands = {posargs}
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
commands =
|
commands =
|
||||||
coverage erase
|
coverage erase
|
||||||
coverage run {toxinidir}/manage.py test stacktask_ui
|
coverage run {toxinidir}/manage.py test adjutant_ui
|
||||||
coverage xml --omit '.tox/cover/*' -o 'cover/coverage.xml'
|
coverage xml --omit '.tox/cover/*' -o 'cover/coverage.xml'
|
||||||
coverage html --omit '.tox/cover/*' -d 'cover/htmlcov'
|
coverage html --omit '.tox/cover/*' -d 'cover/htmlcov'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue