-
Notifications
You must be signed in to change notification settings - Fork 355
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
Build resource group and resource relations #673
Build resource group and resource relations #673
Conversation
delfin/db/sqlalchemy/api.py
Outdated
@@ -2490,7 +2490,7 @@ def masking_views_delete_by_storage(context, storage_id): | |||
|
|||
|
|||
def _storage_host_grp_host_rels_get_query(context, session=None): | |||
return model_query(context, models.StorageHostGrpHostRel, | |||
return model_query(context, models.StorageHostGroupRelation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
U can refer table names from existing models and update the usages accordingly
3977271
to
c5a52f1
Compare
Codecov Report
@@ Coverage Diff @@
## master #673 +/- ##
==========================================
+ Coverage 70.15% 70.83% +0.68%
==========================================
Files 156 156
Lines 14801 14913 +112
Branches 1822 1855 +33
==========================================
+ Hits 10384 10564 +180
+ Misses 3816 3743 -73
- Partials 601 606 +5
|
@@ -741,6 +815,12 @@ def sync(self): | |||
# Build relation between host grp and host to be handled here. | |||
storage_host_groups = self.driver_api \ | |||
.list_storage_host_groups(self.context, self.storage_id) | |||
if storage_host_groups: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever we build group relations for any sync cycle, old relations to be flushed first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already doing it, line no: 89,115,136
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, fine, missed it
delfin/db/sqlalchemy/models.py
Outdated
@@ -366,7 +366,7 @@ class StorageHostGrpHostRel(BASE, DelfinBase): | |||
"""Represents the storage host group and storage host relation | |||
attributes. | |||
""" | |||
__tablename__ = 'storage_host_grp_host_rels' | |||
__tablename__ = 'storage_host_group_relations' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently tablename is in sync with class name, I think we can follow same convention here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks.
c5a52f1
to
2deeaec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add some UTs for host mapping APIS..
LGTM |
9d5e0ee
to
53aad5f
Compare
53aad5f
to
5ab57f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does / why we need it:
Build resource group and resource relations for resources of storage host, port and volume.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Release note: