On 08/15/2016 03:40 AM, Ryan Moats wrote:
Ben Pfaff <b...@ovn.org> wrote on 08/14/2016 07:38:08 PM:

From: Ben Pfaff <b...@ovn.org>
To: Ryan Moats/Omaha/IBM@IBMUS
Cc: dev@openvswitch.org, Matthew Mulsow/Austin/IBM@IBMUS
Date: 08/14/2016 07:38 PM
Subject: Re: [ovs-dev] [PATCH] ovs-ctl: Properly handle shell
quoting inos-release.

On Sun, Aug 14, 2016 at 06:57:54PM -0500, Ryan Moats wrote:
"dev" <dev-boun...@openvswitch.org> wrote on 08/14/2016 02:39:56 PM:

From: Ben Pfaff <b...@ovn.org>
To: dev@openvswitch.org
Cc: Matthew Mulsow/Austin/IBM@IBMUS, Ben Pfaff <b...@ovn.org>
Date: 08/14/2016 02:40 PM
Subject: [ovs-dev] [PATCH] ovs-ctl: Properly handle shell quoting in
os-release.
Sent by: "dev" <dev-boun...@openvswitch.org>

Until now, this code did not strip "" or '' from variable assignments
in
os-release.  This fixes the problem.

CC: Matt Mulsow <mamul...@us.ibm.com>
Fixes: c60d6b096436 ("ovs-ctl: support populating system info from /
etc/os-release")
Signed-off-by: Ben Pfaff <b...@ovn.org>
---
I have not tested this.

 utilities/ovs-ctl.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index ff3eaf2..dc275f8 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -523,8 +523,8 @@ set_defaults () {
         SYSTEM_TYPE=`cat $type_file`
         SYSTEM_VERSION=`cat $version_file`
     elif test -e "@sysconfdir@/os-release"; then
-        SYSTEM_TYPE=`awk -F= '/^ID=/{print $2}'
@sysconfdir@/os-release`
-        SYSTEM_VERSION=`awk -F= '/^VERSION_ID=/{print $2}'
@sysconfdir@/os-release`
+        SYSTEM_TYPE=`. '@sysconfdir@/os-release' && echo "$ID"`
+        SYSTEM_VERSION=`. '@sysconfdir@/os-release' && echo
"$VERSION_ID"`
     elif (lsb_release --id) >/dev/null 2>&1; then
         SYSTEM_TYPE=`lsb_release --id -s`
         system_release=`lsb_release --release -s`
--
2.1.3

I've not seen this problem in our tests, but I have seen in it our
wild,
so...

Acked-by: Ryan Moats <rmo...@us.ibm.com>

I should have included:

    Requested-by: Matt Mulsow <mamul...@us.ibm.com>
    Requested-at: https://github.com/openvswitch/ovs/pull/148

Anyway, I added those and applied this, thanks for the review.


Thanks, this hit us at the start of the weekend and folks have been
dealing with it...

Sorry about that. I did see the quotes there but then, there are quotes in lsb_release-generated system-release too:

[root@sopuli ~]# ovs-vsctl get Open_vSwitch . system-type
Fedora
[root@sopuli ~]# ovs-vsctl get Open_vSwitch . system-version
"24-TwentyFour"
[root@sopuli ~]#

...so I shrugged it off, thinking perhaps its intentional for one reason or another.

        - Panu -

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to