diff mbox series

utils: check to_stdout return correctly in bond2team

Message ID e0c466eebb3e1de3e7608c34f7be6c53318ff352.1532507080.git.lucien.xin@gmail.com (mailing list archive)
State New
Headers show
Series utils: check to_stdout return correctly in bond2team | expand

Commit Message

Xin Long July 25, 2018, 8:24 a.m. UTC
to_stdout is a function, not a string, so fix the check on
its return in bond2team.

Fixes: d5a1c8ee9e36 ("utils: add bond2team conversion tool")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 utils/bond2team | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Xin Long July 26, 2018, 12:11 p.m. UTC | #1
On Wed, Jul 25, 2018 at 9:51 PM, Flavio Leitner <fbl@redhat.com> wrote:
> On Wed, Jul 25, 2018 at 04:24:40PM +0800, Xin Long wrote:
>> to_stdout is a function, not a string, so fix the check on
>> its return in bond2team.
>>
>> Fixes: d5a1c8ee9e36 ("utils: add bond2team conversion tool")
>> Signed-off-by: Xin Long <lucien.xin@gmail.com>
>> ---
>>  utils/bond2team | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/utils/bond2team b/utils/bond2team
>> index f8d46ef..1a3d7d6 100755
>> --- a/utils/bond2team
>> +++ b/utils/bond2team
>> @@ -623,9 +623,7 @@ team_ifcfg_write()
>>  team_ifcfg_deliver()
>>  {
>>       pr_dbg "${FUNCNAME} $*"
>> -     if [ ! to_stdout ]; then
>> -             return 0
>> -     fi
>> +     to_stdout || return 0
>>
>>       if [ -z "${OUTPUT_DIR}" ]; then
>>               show_output_files
>
> Although that fixes the problem, it's not the coding style.
> Would this work for you?
Sure, will post v2.

>
> diff --git a/utils/bond2team b/utils/bond2team
> index f8d46ef..fc81c4b 100755
> --- a/utils/bond2team
> +++ b/utils/bond2team
> @@ -623,7 +623,7 @@ team_ifcfg_write()
>  team_ifcfg_deliver()
>  {
>         pr_dbg "${FUNCNAME} $*"
> -       if [ ! to_stdout ]; then
> +       if ! to_stdout; then
>                 return 0
>         fi
>
>
> --
> Flavio
diff mbox series

Patch

diff --git a/utils/bond2team b/utils/bond2team
index f8d46ef..1a3d7d6 100755
--- a/utils/bond2team
+++ b/utils/bond2team
@@ -623,9 +623,7 @@  team_ifcfg_write()
 team_ifcfg_deliver()
 {
 	pr_dbg "${FUNCNAME} $*"
-	if [ ! to_stdout ]; then
-		return 0
-	fi
+	to_stdout || return 0
 
 	if [ -z "${OUTPUT_DIR}" ]; then
 		show_output_files