On 3/20/24 19:05, Mike Pattrick wrote:
> In v4.0, LibreSwan changed a default paths that had been hardcoded in
> ovs-monitor-ipsec, breaking some uses of this script. This patch adds
> support for both old and newer versions by auto detecting the version
> of LibreSwan and then choosing the correct path.
> 
> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1975039
> Reported-by: Qijun Ding <qd...@redhat.com>
> Fixes: d6afbc00d5b3 ("ipsec: Allow custom file locations.")
> Signed-off-by: Mike Pattrick <m...@redhat.com>
> ---
> v2: Don't extract variables from ipsec script
> ---
>  ipsec/ovs-monitor-ipsec.in | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/ipsec/ovs-monitor-ipsec.in b/ipsec/ovs-monitor-ipsec.in
> index 7945162f9..6a71d4f2f 100755
> --- a/ipsec/ovs-monitor-ipsec.in
> +++ b/ipsec/ovs-monitor-ipsec.in
> @@ -21,6 +21,7 @@ import re
>  import subprocess
>  import sys
>  from string import Template
> +from packaging.version import parse

Hmm.  This is not part of a standard library, it's a new dependency
for the script.  We either need to add python3-packaging as a new
dependency or find a different way of checking.  The latter is likely
a better option.  Just parsing out the first number before the dot
and converting to integer might be an easier solution.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to