Go to file
Stephen Finucane a11c3d3161 Don't modify Resource fields in place
Attribute accesses in SDK pass through a type-conversion utility method
that is responsible for ensuring the following behavior:

  >>> class Demo(resource.Resource):
  ...     foo = resource.Body('foo', type=str)
  ...
  >>> demo = Demo(foo=123)
  >>> demo.foo
  '123'  # result is cast to a string

Unfortunately, because of how this is implemented, attribute accesses
can result result in a copy of the attribute being returned, rather than
the attribute itself. This means attempts to modify mutable attributes
in-place can end up modifying a copy of the attributes, rather than the
attribute itself.

  >>> class Demo(resource.Resource):
  ...     foo = resource.Body('foo', type=list, list_type=str)
  ...
  >>> demo = Demo(foo=[123])
  >>> demo.foo
  ['123']  # items are cast to strings
  >>> demo.foo.append(456)
  >>> demo.foo
  ['123']  # 456 is missing!

This was not previously an issue for horizon as we were not hitting any
of these cases, however, in in openstacksdk 4.3.0, a bug was addressed
where conversion would not happen if using 'type=list', if 'list_type'
was unset, and if the item was a set or tuple (i.e. not a list).

  >>> class Demo(resource.Resource):
  ...     foo = resource.Body('foo', type=list)
  ...
  >>> demo = Demo(foo={'123'})
  >>> demo.foo
  {'123'}  # should be a list!

This has now been fixed, however, the bugfix has exposed a case where we
were in fact modifying a mutable list in-place.

The long-term fix lies in changing how openstacksdk works, so that it
always return the original attribute rather potentially returning a
copy. However, this fix is likely going to be rather involved and not
something we want to cram into the end of the Epoxy release. Instead,
modify Horizon so that it updates the entire attribute rather than
modifying it in place.

Change-Id: I6e7814ea16ca84689b363a53f22de62800c1f0d8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Related-bug: #2100605
2025-02-28 13:49:57 +00:00
2025-02-15 09:36:34 +09:00
2020-09-10 06:10:38 +00:00
2016-03-31 14:06:45 +00:00
2019-04-19 19:37:19 +00:00
2013-10-25 14:49:23 +08:00
2011-01-12 13:43:31 -08:00
2023-09-19 13:18:18 +09:00
2018-07-10 14:45:26 +07:00
2024-03-13 19:25:18 +09:00
2024-06-12 14:21:34 +09:00
2022-06-06 17:59:13 +09:00
2024-04-30 18:04:43 +09:00

Horizon (OpenStack Dashboard)

Horizon is a Django-based project aimed at providing a complete OpenStack Dashboard along with an extensible framework for building new dashboards from reusable components. The openstack_dashboard module is a reference implementation of a Django site that uses the horizon app to provide web-based interactions with the various OpenStack projects.

image

Using Horizon

See doc/source/install/index.rst about how to install Horizon in your OpenStack setup. It describes the example steps and has pointers for more detailed settings and configurations.

It is also available at Installation Guide.

Getting Started for Developers

doc/source/quickstart.rst or Quickstart Guide describes how to setup Horizon development environment and start development.

Building Contributor Documentation

This documentation is written by contributors, for contributors.

The source is maintained in the doc/source directory using reStructuredText and built by Sphinx

To build the docs, use:

$ tox -e docs

Results are in the doc/build/html directory

Description
OpenStack Dashboard (Horizon)
Readme 334 MiB
Languages
Python 63.2%
JavaScript 28.7%
HTML 6.5%
SCSS 1.5%