Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Move to query package #290

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/DEVELOPER_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ There are currently 4 API submodules:

4. Openstack Query API - A python library developed by the Cloud Team to make querying Openstack easier.
- This is in active development, and we're aiming to move this out of this pack to be a standalone library.
- See [Openstack Query README.md](../lib/openstack_query/README.md)
- See [Openstack Query README.md](https://github.com/stfc/openstack-query-library/blob/main/README.md)


There are also several folders which contain shared components used by multiple API submodules.
Expand Down Expand Up @@ -140,6 +140,6 @@ We've implemented a python package to allow querying for OpenStack resources.
This is built on top of the standard openstacksdk library and implements more query features, and allows running
more complex queries.

See the Query Library [README.md](../lib/openstack_query/README.md)
See the Query Library [README.md](https://github.com/stfc/openstack-query-library/blob/main/README.md)

This will soon be extracted out into a separate repo soon.
Empty file.
70 changes: 0 additions & 70 deletions lib/custom_types/openstack_query/aliases.py

This file was deleted.

62 changes: 29 additions & 33 deletions lib/enums/hypervisor_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,35 @@ class HypervisorState(Enum):
Class of states used for automating maintenace of hypervisors
"""

RUNNING = auto()
PENDING_MAINTENANCE = auto()
DRAINING = auto()
DRAINED = auto()
RUNNING = {
"uptime": True,
"enabled": True,
"state": True,
"servers": True,
}
PENDING_MAINTENANCE = {
"uptime": False,
"enabled": True,
"state": True,
"servers": True,
}
DRAINING = {
"uptime": False,
"enabled": False,
"state": True,
"servers": True,
}
DRAINED = {
"uptime": False,
"enabled": False,
"state": True,
"servers": False,
}
UNKNOWN = auto()

def properties(self):
@classmethod
def _missing_(cls, value):
"""
Return hypervisor state for given variables
Return UNKNOWN if state not found in class
"""
state_properties = {
HypervisorState.RUNNING: {
"uptime": True,
"enabled": True,
"state": True,
"servers": True,
},
HypervisorState.PENDING_MAINTENANCE: {
"uptime": False,
"enabled": True,
"state": True,
"servers": True,
},
HypervisorState.DRAINING: {
"uptime": False,
"enabled": False,
"state": True,
"servers": True,
},
HypervisorState.DRAINED: {
"uptime": False,
"enabled": False,
"state": True,
"servers": False,
},
}
return state_properties[self]
return cls.UNKNOWN
Empty file removed lib/enums/query/__init__.py
Empty file.
37 changes: 0 additions & 37 deletions lib/enums/query/enum_with_aliases.py

This file was deleted.

12 changes: 0 additions & 12 deletions lib/enums/query/props/__init__.py

This file was deleted.

76 changes: 0 additions & 76 deletions lib/enums/query/props/flavor_properties.py

This file was deleted.

111 changes: 0 additions & 111 deletions lib/enums/query/props/hypervisor_properties.py

This file was deleted.

Loading
Loading