Skip to content

Commit

Permalink
Fixed GeoReplicationSession field reference
Browse files Browse the repository at this point in the history
There is no field with name `key`. We need to refer the field
value for the session_id for further calculation of pairs of
the geo replication session. Corrected the same as part this
change.

tendrl-bug-id: Tendrl#684
bugzilla: 1603175
Signed-off-by: Shubhendu <shtripat@redhat.com>
  • Loading branch information
Shubhendu committed Jul 20, 2018
1 parent db5ebd0 commit ba4c77f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tendrl/gluster_integration/sds_sync/georep_details.py
@@ -1,5 +1,6 @@
import etcd

from tendrl.commons.utils import etcd_utils
from tendrl.commons.utils import event_utils
from tendrl.gluster_integration.objects.geo_replication_session\
import GeoReplicationSessionStatus
Expand Down Expand Up @@ -177,20 +178,21 @@ def aggregate_session_status():
vol_id = volume.vol_id
sessions = None
try:
sessions = NS.tendrl.objects.GeoReplicationSession(
vol_id=volume.vol_id
).load_all()
sessions = etcd_utils.read(
"clusters/%s/Volumes/%s/GeoRepSessions" % (
NS.tendrl_context.integration_id,
vol_id
)
)
except etcd.EtcdKeyNotFound:
pass
continue
pair_count = int(volume.brick_count)
if sessions is None:
sessions = []
for session in sessions:
for session in sessions.leaves:
session_status = None
session_id = session.key.split("GeoRepSessions/")[-1]
pairs = NS.gluster.objects.GeoReplicationPair(
vol_id=vol_id,
session_id=session.session_id
session_id=session_id
).load_all()
faulty_count = 0
stopped_count = 0
Expand Down

0 comments on commit ba4c77f

Please sign in to comment.