sushy-tools/sushy_tools/error.py
Ilya Etingof 499536afcb Redirect to UUID URLs
Redfish ComputerSystem is addressed by Redfish resource `Id`,
while the resource can also carry the `name` and/or `uuid`
properties.

Technically, Redfish emulator could respond to queries performed
against `uuid` and `name`. This change makes Redfish emulator
HTTP redirecting all queries performed against `name` to the same
REST endpoint addressing the same ComputerSystem by its `uuid`
as a more canonical.

Also, when listing ComputerSystems, `uuid` is now universally used.
Prior to this change the libvirt driver advertised ComputerSystems
names while nova driver advertised UUIDs.

Story: 2004306
Task: 27867
Change-Id: Ic5dab0a5642d65d832f66092b7bf178ec58a3655
2018-12-04 13:55:56 +01:00

23 lines
806 B
Python

# Copyright 2018 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
class FishyError(Exception):
"""Create generic sushy-tools exception object"""
class AliasAccessError(FishyError):
"""Node access attempted via an alias, not UUID"""