From patchwork Mon Jul 20 08:52:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 11673227 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4E95138C for ; Mon, 20 Jul 2020 08:53:23 +0000 (UTC) Received: from bastion.fedoraproject.org (bastion-iad01.fedoraproject.org [38.145.60.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 72B4E2080D for ; Mon, 20 Jul 2020 08:53:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72B4E2080D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=libteam-bounces@lists.fedorahosted.org Received: from mailman01.iad2.fedoraproject.org (mailman01.iad2.fedoraproject.org [10.3.163.57]) by bastion01.iad2.fedoraproject.org (Postfix) with ESMTP id 393B430B3C23; Mon, 20 Jul 2020 08:53:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 bastion01.iad2.fedoraproject.org 393B430B3C23 Received: from mailman01.iad2.fedoraproject.org (localhost [IPv6:::1]) by mailman01.iad2.fedoraproject.org (Postfix) with ESMTP id 3503F5E89DAD7; Mon, 20 Jul 2020 08:53:12 +0000 (UTC) Received: by mailman01.iad2.fedoraproject.org (Postfix, from userid 991) id 596565E89DAD3; Mon, 20 Jul 2020 08:53:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mailman01.iad2.fedoraproject.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=disabled version=3.4.0 Received: from smtp-mm-osuosl01.fedoraproject.org (smtp-mm-osuosl01.vpn.fedoraproject.org [192.168.1.23]) by mailman01.iad2.fedoraproject.org (Postfix) with ESMTP id 14BD55E89DACE for ; Mon, 20 Jul 2020 08:53:10 +0000 (UTC) Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by smtp-mm-osuosl01.fedoraproject.org (Postfix) with ESMTPS id B13A098062 for ; Mon, 20 Jul 2020 08:53:09 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id o13so10007101pgf.0 for ; Mon, 20 Jul 2020 01:53:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6plhAP/Io/j85Xb85zN/zpGuxiLcQi9X3uLQeV4HfVk=; b=V87eWFcaquU/J3U45KOruNDonbspvzoL8ke6/kLYbmQX5PvbrcKoFsDJpwh3j7kNFy 7qwLrUMKYjmDNwVADH/bGFvn2J6Opp9+WX1zVbEfUvR3Wn0Za61luNB8Dv0iIwBqS8WI v80AP3EMEX74gUuhXTlFODLsnsIKXmnOwS5FLY/0wOjxML83trLLWOR85omiYNQskM7F lsgvJ4PXrpO12pPYVdgiEmzHWpRIEfNPnn2lP5q5pJhLG2+fLCW9XPthqXOlnDQf65gF o2bIjcRbLEciIgDxbLhqTJ6HYyZl/Vvj8Fn+GRz9yCNmOyIBmrVl6f+Cm9Cs4XcMcSaU SOtw== X-Gm-Message-State: AOAM531R5Rwma1HKeAqs0rCYNX6ImS/L3f8UFu0rF+RSpufwDa9QW8A5 g3mHNO18oEOVYHoFZmmwcqOmBwPmvdvU8Q== X-Google-Smtp-Source: ABdhPJzN7Lm/bYVc4NuhWv0KiRK0TK1/ziUIv/pSK0iN69zrTO0sQdwryLRS5XTyE1giyNpQB4/cqQ== X-Received: by 2002:a62:33c5:: with SMTP id z188mr18495699pfz.180.1595235188758; Mon, 20 Jul 2020 01:53:08 -0700 (PDT) Received: from dhcp-12-153.nay.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id g3sm15894261pfq.19.2020.07.20.01.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 01:53:08 -0700 (PDT) From: Hangbin Liu To: libteam@lists.fedorahosted.org Subject: [PATCH libteam] utils/bond2team: keep delivering config to file if stdout not supplied Date: Mon, 20 Jul 2020 16:52:56 +0800 Message-Id: <20200720085256.2105074-1-liuhangbin@gmail.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Message-ID-Hash: YSIMBLRTKLLOJOA5EYKHEX4XD5A7QAIR X-Message-ID-Hash: YSIMBLRTKLLOJOA5EYKHEX4XD5A7QAIR X-MailFrom: liuhangbin@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Jiri Pirko , Hangbin Liu X-Mailman-Version: 3.1.1 Precedence: list List-Id: Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: When --stdout not supplied, we should keep on delivering the config file instead of return. Before the fix: $ bond2team --configdir ./bonding/ --master bond0 --rename team0 $ bond2team --configdir bonding/ --outputdir teaming/ --master bond0 --rename team0 $ ls teaming/ After the fix: $ bond2team --configdir ./bonding/ --master bond0 --rename team0 Resulted files: /tmp/bond2team.nV4eX3/ifcfg-team0 /tmp/bond2team.nV4eX3/ifcfg-eth1 /tmp/bond2team.nV4eX3/ifcfg-eth2 $ bond2team --configdir bonding/ --outputdir teaming/ --master bond0 --rename team0 $ ls teaming/ ifcfg-eth1 ifcfg-eth2 ifcfg-team0 Fixes: d5a1c8ee9e36 ("utils: add bond2team conversion tool") Signed-off-by: Hangbin Liu --- utils/bond2team | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/bond2team b/utils/bond2team index fc81c4b..28733da 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