Add a json attribute to CreatedResponse and JSONResponse of
openstack_dashboard.api.rest.utils.
This patch changes unit tests: they now compare deserialized JSON
data instead of comparing the serialized JSON data which depends on
the exact hash function
This change makes the code more readable, but it was written to port
openstack_dashboard to Python 3. On Python 3, the hash function is
now randomized by default, so dictionary items are serialized in a
random order by JSON. Moreover, the hash function is different on
Python 2 and Python 3, so setting PYTHONHASHSEED=0 in tox.ini is not
enough to have a reliable JSON serialized ouput in all cases.
Fix also NaNJSONEncoder: On Python 3, don't try to decode bytes from
the encoder encoding, since the JSON encoder has no more encoding on
Python 3: it produces an Unicode string.
Partial-Implements: blueprint porting-python3
Change-Id: I8503ee530d4122b2ce733d02023454796934c8e6
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Do this by representing every float('inf') python numeric as a 1e+999
JSON token - this way Javascript JSON.parse() correctly transforms it
to the Javascript Infinity object. The infinity value corresponds to
disabled limits.
The logic of representing infinity values as 1e+999 tokens is
implemented by means of custom `NaNJSONEncoder` which overrides
`iterencode` method of its `json.JSONEncoder` ancestor. Due to the
fact that the ancestor method could take an advantage of
`c_make_encoder` function (which is implemented in C) - and thus could
be much faster, I'm using the custom encoder only where it's really
needed, to not hamper Horizon performance.
Rewrite pie-chart directive rendering according to
https://invis.io/A4445BDSF
Change-Id: If498d9ccd5f0144c9e78ae58583ede2c1cf83f0b
Closes-Bug: #1482705
The exception list is not properly used. The exception list is a
settings constant that can be modified within the settings file. Having
the list in openstack_dashboard/exceptions.py confuses the
developers. The list of exceptions are moved in the settings file and
removed all duplications.
Partially Implements: blueprint improve-error-message-details-for-usability
Change-Id: I5e19c3f0b84b17fa28f6e3c113467cc19d9b0a03
In this update:
- fixed tests
- fixed exception handling, params on ports
- fixed to_dict for a number of cases
- replaced use of request.DATA with request.GET for GET methods
- added handling of HTTP error raised with no status/code attr
- removed check for network_id in subnets as it's not required
- fix to_dict for Network with Subnets
Supercedes
https://review.openstack.org/#/c/152243https://review.openstack.org/#/c/151313
Partially Implements: blueprint launch-instance-redesign
Co-Authored-By: Aaron Sahlin <asahlin@us.ibm.com>
Co-Authored-By: Michael Hagedorn <mike.hagedorn@hp.com>
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Change-Id: Ia40fde6d66720a03a531b516a6a53a2e86ec0d8f
Add the filter functionality that Keystone supports.
Used by Randy's Magic Search patch:
https://review.openstack.org/#/c/151386/.
Also refactor out parse_filters_kwargs method which is used
by several rest api.
Co-Authored-By: Justin Pomeroy <jpomero@linux.vnet.ibm.com>
Change-Id: Ib65395eae345e1368fbb45f6b4ce3cbb9595d61b
Partially-Implements: blueprint filtered-client-side-table
This patch adds an Angular service to isolate client-side code from REST API
changes, and also changes the REST API to use PATCH instead of PUT as the
update verb. Except the one new PUT method for granting a role.
Multiple DELETE is removed from the overloaded POST actions, and the role
grant is moved to a PUT action.
The new angular API service implements error handling by default.
The request Python API JSON body test was made more sane. Thanks to all the
reviewers who brought that up, I finally saw the light!
Change-Id: Ifd58fbf4fac3c3f53dc4769fd76cddfa3101d9d2
oslo.config is now deprecated, so switching
from oslo.config to right package oslo_config.
similarly oslo.serialization also deprecated, it
is also switched to oslo_serialization from
oslo.serialization.
Change-Id: I52eff48a17a555750379e4ca6bb024fc71a4efeb
Closes-Bug: #1409733
This is the start of the API to support the angular front end.
It is missing endpoints not immediately used by angular WIPs other
than the identity re-work, but is enough to start with.
Changes:
- handle additional HTTP status code attribute
- move common helpers from test modules to here
Partially Implements: blueprint angularize-identity-tables
Change-Id: I7495f772be80125fdf52b02883a5b9942db34610