Skip to content

Commit

Permalink
version.h: define few macros for simplifying
Browse files Browse the repository at this point in the history
Reviewed-by: Xiubo Li <[email protected]>
Signed-off-by: Prasanna Kumar Kalever <[email protected]>
  • Loading branch information
Prasanna Kumar Kalever authored and pkalever committed Oct 17, 2019
1 parent 61432ed commit ec14ce7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions daemon/gluster-blockd.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ gbDependenciesVersionCheck(void)
char *out = NULL;


out = gbRunnerGetOutput("tcmu-runner --version 2>&1 | awk -F' ' '{printf $NF}'");
out = gbRunnerGetOutput(TCMU_VERSION);
if (!gbDependencyVersionCompare(TCMURUNNER, out)) {
LOG ("mgmt", GB_LOG_ERROR,
"current tcmu-runner version is %s, gluster-block need atleast - %s",
Expand All @@ -440,7 +440,7 @@ gbDependenciesVersionCheck(void)
LOG("mgmt", GB_LOG_INFO, "starting with tcmu-runner version - %s", out);
GB_FREE(out);

out = gbRunnerGetOutput("targetcli --version 2>&1 | awk -F' ' '{printf $NF}'");
out = gbRunnerGetOutput(TARGETCLI_VERSION);
if (!gbDependencyVersionCompare(TARGETCLI, out)) {
LOG ("mgmt", GB_LOG_ERROR,
"current targetcli version is %s, gluster-block need atleast - %s",
Expand All @@ -450,7 +450,7 @@ gbDependenciesVersionCheck(void)
LOG("mgmt", GB_LOG_INFO, "starting with targetcli version - %s", out);
GB_FREE(out);

out = gbRunnerGetOutput("python -c 'from rtslib_fb import __version__; print(__version__)'");
out = gbRunnerGetOutput(RTSLIB_VERSION);
if (!strcmp(out, "GIT_VERSION")) {
LOG("mgmt", GB_LOG_INFO, "starting with rtslib version <= 2.1.69");
} else {
Expand Down
6 changes: 3 additions & 3 deletions utils/capabilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ gbBlockSizeDependenciesVersionCheck(void)
int ret = true;


out = gbRunnerGetOutput("python -c 'from rtslib_fb import __version__; print(__version__)'");
out = gbRunnerGetOutput(RTSLIB_VERSION);
if (!gbDependencyVersionCompare(RTSLIB_BLKSIZE, out)) {
ret = false;
}
Expand All @@ -60,14 +60,14 @@ gbBlockReloadDependenciesVersionCheck(void)
int ret = true;


out = gbRunnerGetOutput("python -c 'from rtslib_fb import __version__; print(__version__)'");
out = gbRunnerGetOutput(RTSLIB_VERSION);
if (!gbDependencyVersionCompare(RTSLIB_RELOAD, out)) {
ret = false;
goto out;
}
GB_FREE(out);

out = gbRunnerGetOutput("targetcli --version 2>&1 | awk -F' ' '{printf $NF}'");
out = gbRunnerGetOutput(TARGETCLI_VERSION);
if (!gbDependencyVersionCompare(TARGETCLI_RELOAD, out)) {
ret = false;
}
Expand Down
3 changes: 3 additions & 0 deletions version.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

# define DEPENDENCY_VERSION KERNEL_VERSION

# define TARGETCLI_VERSION "targetcli --version 2>&1 | awk -F' ' '{printf $NF}'"
# define RTSLIB_VERSION "python -c 'from rtslib_fb import version; print(__version__)'"
# define TCMU_VERSION "tcmu-runner --version 2>&1 | awk -F' ' '{printf $NF}'"

# define GLUSTER_BLOCK_VERSION "0.4"

Expand Down

0 comments on commit ec14ce7

Please sign in to comment.