Refactor to allow resource-agnostic validation#248
Refactor to allow resource-agnostic validation#248QuanMPhm wants to merge 1 commit intonerc-project:mainfrom
Conversation
knikolla
left a comment
There was a problem hiding this comment.
This is a good start, but not going as far as I would like in terms of making it "resource-agnostic", as you still have a lot of if resource_name in OPENSHIFT|OPENSTACK.
Try thinking about a way to push those resource-specific functions inside the respective allocators and creating a new function in the base Allocator that serves as the abstraction.
See my comment about validate project exist.
|
|
||
| return quota_str | ||
|
|
||
| def validate_project_exists(self, allocator, project_id, resource_name): |
There was a problem hiding this comment.
You should define this in the coldfront_plugin_cloud.base.ResourceAllocator and then implement these in the OpenStack and OpenShift resource allocators. This would make this part of the codebase be Resource Agnostic.
|
Note-to-self: The branch name for the original solution (before time of this comment) is |
9153d7b to
a86da68
Compare
a86da68 to
40883e2
Compare
Quota validation will now behave the same for both resource types. OpenStack's particular use of default quotas is reflected in a new test in `openstack/test_allocation.py` OpenStack integration code is slightly changed to better handle missing object storage quotas Much of the validation logic has been pushed into `base.py`, `openshift.py`, and `openstack.py`
40883e2 to
129234b
Compare
|
@knikolla I've cleaned house on |
Closes #239. This PR consists of the last commit. Built on top of #245. More details in the commit message.
@knikolla @jtriley I have a small bug in how error handling is done when the object storage quota is missing. Just want to confirm that my change is desirable.