summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.zuul.d/project.yaml1
-rw-r--r--horizon/templates/auth/_login_form.html6
-rw-r--r--horizon/templates/auth/_password_form.html6
-rw-r--r--horizon/utils/functions.py2
-rw-r--r--lower-constraints.txt156
-rw-r--r--openstack_auth/views.py18
-rw-r--r--openstack_dashboard/dashboards/project/instances/tabs.py13
-rw-r--r--openstack_dashboard/locale/es/LC_MESSAGES/django.po12
-rw-r--r--tox.ini6
9 files changed, 41 insertions, 179 deletions
diff --git a/.zuul.d/project.yaml b/.zuul.d/project.yaml
index fe7f60f35..63e461e13 100644
--- a/.zuul.d/project.yaml
+++ b/.zuul.d/project.yaml
@@ -4,7 +4,6 @@
- horizon-cross-jobs
- horizon-nodejs10-jobs
- horizon-non-primary-django-jobs
- - openstack-lower-constraints-jobs
- openstack-python3-victoria-jobs
- periodic-stable-jobs
- publish-openstack-docs-pti
diff --git a/horizon/templates/auth/_login_form.html b/horizon/templates/auth/_login_form.html
index 66ce8ff19..a4a4abad5 100644
--- a/horizon/templates/auth/_login_form.html
+++ b/horizon/templates/auth/_login_form.html
@@ -52,13 +52,13 @@
</p>
</div>
{% endif %}
- {% if request.COOKIES.logout_reason %}
- {% if request.COOKIES.logout_status == "success" %}
+ {% if logout_reason %}
+ {% if logout_status == "success" %}
<div class="form-group clearfix error help-block alert alert-success" id="logout_reason">
{% else %}
<div class="form-group clearfix error help-block alert alert-danger" id="logout_reason">
{% endif %}
- <p>{{ request.COOKIES.logout_reason }}</p>
+ <p>{{ logout_reason }}</p>
</div>
{% endif %}
{% if csrf_failure %}
diff --git a/horizon/templates/auth/_password_form.html b/horizon/templates/auth/_password_form.html
index 45ed92011..3968e767e 100644
--- a/horizon/templates/auth/_password_form.html
+++ b/horizon/templates/auth/_password_form.html
@@ -31,13 +31,13 @@
</div>
{%endif%}
<fieldset hz-login-finder>
- {% if request.COOKIES.logout_reason %}
- {% if request.COOKIES.logout_status == "success" %}
+ {% if logout_reason %}
+ {% if logout_status == "success" %}
<div class="form-group clearfix error help-block alert alert-success" id="logout_reason">
{% else %}
<div class="form-group clearfix error help-block alert alert-danger" id="logout_reason">
{% endif %}
- <p>{{ request.COOKIES.logout_reason }}</p>
+ <p>{{ logout_reason }}</p>
</div>
{% endif %}
{% include "horizon/common/_form_fields.html" %}
diff --git a/horizon/utils/functions.py b/horizon/utils/functions.py
index 1052c8ff8..d454156af 100644
--- a/horizon/utils/functions.py
+++ b/horizon/utils/functions.py
@@ -43,7 +43,7 @@ def add_logout_reason(request, response, reason, status='success'):
# Store the translated string in the cookie
lang = translation.get_language_from_request(request)
with translation.override(lang):
- reason = str(reason)
+ reason = force_text(reason).encode('unicode_escape').decode('ascii')
response.set_cookie('logout_reason', reason, max_age=10)
response.set_cookie('logout_status', status, max_age=10)
diff --git a/lower-constraints.txt b/lower-constraints.txt
deleted file mode 100644
index 1f4d61320..000000000
--- a/lower-constraints.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-alabaster==0.7.10
-amqp==2.1.1
-appdirs==1.4.0
-asn1crypto==0.23.0
-Babel==2.3.4
-bandit==1.4.0
-cachetools==2.0.0
-cffi==1.14.0
-chardet==3.0.4
-cliff==2.8.0
-cmd2==0.8.0
-colorama==0.3.9
-contextlib2==0.4.0
-coverage==4.0
-cryptography==3.0
-debtcollector==1.2.0
-decorator==3.4.0
-deprecation==1.0
-Django==2.2
-django-appconf==1.0.2
-django-compressor==2.0
-django-debreach==1.4.2
-django-pyscss==2.0.2
-docutils==0.11
-dogpile.cache==0.6.2
-dulwich==0.15.0
-enmerkar==0.7.1
-eventlet==0.18.2
-extras==1.0.0
-fasteners==0.7.0
-fixtures==3.0.0
-futurist==1.2.0
-greenlet==0.4.10
-idna==2.6
-imagesize==0.7.1
-iso8601==0.1.11
-Jinja2==2.10
-jmespath==0.9.0
-jsonpatch==1.16
-jsonpointer==1.13
-jsonschema==2.6.0
-keystoneauth1==3.4.0
-kombu==4.0.0
-linecache2==1.0.0
-MarkupSafe==1.0
-mccabe==0.6.0
-monotonic==0.6
-msgpack-python==0.4.0
-munch==2.1.0
-netaddr==0.7.18
-netifaces==0.10.4
-nodeenv==0.9.4
-openstacksdk==0.11.2
-os-client-config==1.28.0
-os-service-types==1.2.0
-osc-lib==1.8.0
-oslo.concurrency==3.26.0
-oslo.config==5.2.0
-oslo.context==2.19.2
-oslo.i18n==3.15.3
-oslo.log==3.36.0
-oslo.messaging==5.29.0
-oslo.middleware==3.31.0
-oslo.policy==1.30.0
-oslo.serialization==2.18.0
-oslo.service==1.24.0
-oslo.upgradecheck==0.1.1
-oslo.utils==3.33.0
-osprofiler==2.3.0
-Paste==2.0.2
-PasteDeploy==1.5.0
-pbr==2.0.0
-pep8==1.5.7
-pika==0.10.0
-pika-pool==0.1.3
-positional==1.2.1
-prettytable==0.7.2
-pycodestyle==2.5.0
-pycparser==2.18
-pyflakes==2.1.0
-Pygments==2.2.0
-pyinotify==0.9.6
-pymongo==3.0.2
-pyOpenSSL==19.1.0
-pyparsing==2.1.0
-pyperclip==1.5.27
-pyScss==1.3.7
-pytest==5.3.5
-pytest-django==3.8.0
-pytest-html==2.0.1
-python-cinderclient==5.0.0
-python-dateutil==2.5.3
-python-glanceclient==2.8.0
-python-keystoneclient==3.22.0
-python-memcached==1.59
-python-mimeparse==1.6.0
-python-neutronclient==6.7.0
-python-novaclient==9.1.0
-python-swiftclient==3.2.0
-pytz==2013.6
-PyYAML==3.12
-rcssmin==1.0.6
-reno==3.1.0
-repoze.lru==0.7
-requests==2.14.2
-requestsexceptions==1.2.0
-restructuredtext-lint==1.1.1
-rfc3986==0.3.1
-rjsmin==1.0.12
-Routes==2.3.1
-selenium==2.50.1
-semantic-version==2.3.1
-simplejson==3.5.1
-six==1.12.0
-snowballstemmer==1.2.1
-statsd==3.2.1
-stevedore==1.20.0
-tenacity==3.2.1
-termcolor==1.1.0
-testscenarios==0.4
-testtools==2.2.0
-traceback2==1.4.0
-unittest2==1.1.0
-vine==1.1.4
-warlock==1.2.0
-WebOb==1.7.1
-wrapt==1.11
-XStatic==1.0.0
-XStatic-Angular==1.5.8.0
-XStatic-Angular-Bootstrap==2.2.0.0
-XStatic-Angular-FileUpload==12.0.4.0
-XStatic-Angular-Gettext==2.3.8.0
-XStatic-Angular-lrdragndrop==1.0.2.2
-XStatic-Angular-Schema-Form==0.8.13.0
-XStatic-Bootstrap-Datepicker==1.3.1.0
-XStatic-Bootstrap-SCSS==3.3.7.1
-XStatic-bootswatch==3.3.7.0
-XStatic-D3==3.5.17.0
-XStatic-Font-Awesome==4.7.0.0
-XStatic-Hogan==2.0.0.2
-XStatic-Jasmine==2.4.1.1
-XStatic-jQuery==1.8.2.1
-XStatic-JQuery-Migrate==1.2.1.1
-XStatic-jquery-ui==1.10.4.1
-XStatic-JQuery.quicksearch==2.0.3.1
-XStatic-JQuery.TableSorter==2.14.5.1
-XStatic-JSEncrypt==2.3.1.1
-XStatic-mdi==1.6.50.2
-XStatic-objectpath==1.2.1.0
-XStatic-Rickshaw==1.5.0.0
-XStatic-roboto-fontface==0.5.0.0
-XStatic-smart-table==1.4.13.2
-XStatic-Spin==1.2.5.2
-XStatic-term.js==0.0.7.0
-XStatic-tv4==1.2.7.0
-xvfbwrapper==0.1.3
diff --git a/openstack_auth/views.py b/openstack_auth/views.py
index 11c8628ca..5eaa1da6d 100644
--- a/openstack_auth/views.py
+++ b/openstack_auth/views.py
@@ -66,6 +66,11 @@ def get_csrf_reason(reason):
return reason
+def set_logout_reason(res, msg):
+ msg = msg.encode('unicode_escape').decode('ascii')
+ res.set_cookie('logout_reason', msg, max_age=10)
+
+
# TODO(stephenfin): Migrate to CBV
@sensitive_post_parameters()
@csrf_protect
@@ -122,6 +127,9 @@ def login(request):
choices = settings.WEBSSO_CHOICES
reason = get_csrf_reason(request.GET.get('csrf_failure'))
+ logout_reason = request.COOKIES.get(
+ 'logout_reason', '').encode('ascii').decode('unicode_escape')
+ logout_status = request.COOKIES.get('logout_status')
extra_context = {
'redirect_field_name': auth.REDIRECT_FIELD_NAME,
'csrf_failure': reason,
@@ -131,6 +139,8 @@ def login(request):
'single_value': '',
'label': '',
},
+ 'logout_reason': logout_reason,
+ 'logout_status': logout_status,
}
if request.is_ajax():
@@ -150,7 +160,7 @@ def login(request):
res = django_http.HttpResponseRedirect(
reverse('password', args=[exc.user_id]))
msg = _("Your password has expired. Please set a new password.")
- res.set_cookie('logout_reason', msg, max_age=10)
+ set_logout_reason(res, msg)
# Save the region in the cookie, this is used as the default
# selected region next time the Login form loads.
@@ -201,7 +211,7 @@ def websso(request):
else:
msg = 'Login failed: %s' % exc
res = django_http.HttpResponseRedirect(settings.LOGIN_URL)
- res.set_cookie('logout_reason', msg, max_age=10)
+ set_logout_reason(res, msg)
return res
auth_user.set_session_from_user(request, request.user)
@@ -373,7 +383,7 @@ def switch_keystone_provider(request, keystone_provider=None,
except exceptions.KeystoneAuthException as exc:
msg = 'Keystone provider switch failed: %s' % exc
res = django_http.HttpResponseRedirect(settings.LOGIN_URL)
- res.set_cookie('logout_reason', msg, max_age=10)
+ set_logout_reason(res, msg)
return res
auth.login(request, request.user)
auth_user.set_session_from_user(request, request.user)
@@ -403,5 +413,5 @@ class PasswordView(edit_views.FormView):
# We have no session here, so regular messages don't work.
msg = _('Password changed. Please log in to continue.')
res = django_http.HttpResponseRedirect(self.success_url)
- res.set_cookie('logout_reason', msg, max_age=10)
+ set_logout_reason(res, msg)
return res
diff --git a/openstack_dashboard/dashboards/project/instances/tabs.py b/openstack_dashboard/dashboards/project/instances/tabs.py
index 686d03798..89d20b6fe 100644
--- a/openstack_dashboard/dashboards/project/instances/tabs.py
+++ b/openstack_dashboard/dashboards/project/instances/tabs.py
@@ -40,12 +40,19 @@ class OverviewTab(tabs.Tab):
try:
volume = api.cinder.volume_get(
self.request, volume_id=instance.volumes[0].volumeId)
- instance.image = {
- 'id': volume.volume_image_metadata['image_id'],
- 'name': volume.volume_image_metadata['image_name']}
except Exception:
exceptions.handle(self.request,
_('Failed to get attached volume.'))
+ try:
+ instance.image = {
+ 'id': volume.volume_image_metadata['image_id'],
+ 'name': volume.volume_image_metadata['image_name'],
+ }
+ except (AttributeError, KeyError):
+ # AttributeError is raised when volume_image_metadata does not
+ # exist. KeyError is raised when volume_image_metadata exists
+ # but image_id or image_name is not included.
+ instance.image = None
return {"instance": instance}
diff --git a/openstack_dashboard/locale/es/LC_MESSAGES/django.po b/openstack_dashboard/locale/es/LC_MESSAGES/django.po
index 3c389e59d..0767964f2 100644
--- a/openstack_dashboard/locale/es/LC_MESSAGES/django.po
+++ b/openstack_dashboard/locale/es/LC_MESSAGES/django.po
@@ -15,11 +15,11 @@ msgid ""
msgstr ""
"Project-Id-Version: horizon VERSION\n"
"Report-Msgid-Bugs-To: https://bugs.launchpad.net/openstack-i18n/\n"
-"POT-Creation-Date: 2021-06-04 10:52+0000\n"
+"POT-Creation-Date: 2021-10-19 15:08+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2021-06-04 10:28+0000\n"
+"PO-Revision-Date: 2021-11-20 05:16+0000\n"
"Last-Translator: Alberto Molina Coballes <alberto@tinaja.es>\n"
"Language-Team: Spanish\n"
"Language: es\n"
@@ -4986,6 +4986,11 @@ msgstr "Pendiente a Eliminar"
msgid "Per Volume Size (GiB)"
msgstr "Tamaño por volumen (GiB)"
+msgid "Perform a check to see if the application is ready for upgrade."
+msgstr ""
+"Realizar una comprobación para ver si la aplicación está lista para la "
+"actualización."
+
msgid "Physical Network"
msgstr "Red física"
@@ -6554,6 +6559,9 @@ msgstr "Sistema"
msgid "System Information"
msgstr "Información del Sistema"
+msgid "System Scope"
+msgstr "Ámbito del sistema"
+
msgid "Target Host"
msgstr "Anfitrión destino"
diff --git a/tox.ini b/tox.ini
index 69151f92c..a5feba6e7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -27,12 +27,6 @@ commands =
find . -type f -name "*.pyc" -delete
bash {toxinidir}/tools/unit_tests.sh {toxinidir} {posargs}
-[testenv:lower-constraints]
-deps =
- -c{toxinidir}/lower-constraints.txt
- -r{toxinidir}/test-requirements.txt
- -r{toxinidir}/requirements.txt
-
[testenv:venv]
envdir = {toxworkdir}/venv
commands = {posargs}