Skip to content

Commit

Permalink
Merge pull request #59 from r0h4n/master
Browse files Browse the repository at this point in the history
Adds Tendrl_context.sds_version during cluster register
  • Loading branch information
r0h4n committed Nov 16, 2016
2 parents 317c919 + 7d78558 commit 3074264
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tendrl/gluster_integration/manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ def register_to_cluster(self, cluster_id):
TendrlContext(
updated=str(time.time()),
cluster_id=cluster_id,
sds_name="gluster"
sds_name="gluster",
sds_version=utils.get_sds_version()
)
)

Expand Down
6 changes: 6 additions & 0 deletions tendrl/gluster_integration/manager/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import os
import os.path
import subprocess

LOG = logging.getLogger(__name__)
TENDRL_CONTEXT = "/etc/tendrl/gluster_integration/tendrl_context"
Expand Down Expand Up @@ -29,3 +30,8 @@ def get_node_context():
node_id = f.read()
LOG.info("Node_context.node_id==%s found!" % node_id)
return node_id


def get_sds_version():
res = subprocess.check_output(['gluster', '--version'])
return res.split()[1]

0 comments on commit 3074264

Please sign in to comment.