Closed aravindavk closed 3 months ago
CLANG-FORMAT FAILURE: Before merging the patch, this diff needs to be considered for passing clang-format
index 3e66b0553..ecba8790c 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -131,7 +131,8 @@ cli_cmd_ta_brick_parse(const char **words, int wordcount, char **ta_brick)
ip_len = strlen(host_name);
if (!(strcmp(host_name, "localhost") && strcmp(host_name, "127.0.0.1")) ||
- (valid_ipv4_address(host_name, ip_len, 0) && !strncmp(host_name, "0.", 2))) {
+ (valid_ipv4_address(host_name, ip_len, 0) &&
+ !strncmp(host_name, "0.", 2))) {
cli_err(
"Please provide a valid hostname/ip other "
"than localhost, 127.0.0.1 or loopback "
@@ -232,8 +233,10 @@ cli_cmd_bricks_parse(const char **words, int wordcount, int brick_index,
}
ip_len = strlen(host_name);
- if (!(strcmp(host_name, "localhost") && strcmp(host_name, "127.0.0.1")) ||
- (valid_ipv4_address(host_name, ip_len, 0) && !strncmp(host_name, "0.", 2))) {
+ if (!(strcmp(host_name, "localhost") &&
+ strcmp(host_name, "127.0.0.1")) ||
+ (valid_ipv4_address(host_name, ip_len, 0) &&
+ !strncmp(host_name, "0.", 2))) {
cli_err(
"Please provide a valid hostname/ip other "
"than localhost, 127.0.0.1 or loopback "
/run regression
I would prefer to move the repeated code into a function to avoid code duplication.
Updated.
/run regression
Gluster volume create command fails to use the hostnames that starts with
0.
For example:
Fixes: #4309