Public bug reported:

Tested with StrongSwan but I hope this can cause issues on others
drivers too.

On python3 when new connection is created it's stuck in PENDING_CREATE
state. Everything is working but connection state is never updated. Main
reason is that agent send wrong id to server. On python3 message look
like this:

[{'updated_pending_status': False, 'ipsec_site_connections': {'a':
{'updated_pending_status': False, 'status': 'ACTIVE'}}, 'status':
'ACTIVE', 'id': 'a621a382-308d-4cd0-be0a-01c757064a13'},
{'updated_pending_status': False, 'ipsec_site_connections': {'a':
{'updated_pending_status': False, 'status': 'ACTIVE'}}, 'status':
'ACTIVE', 'id': 'd004c466-cc36-4b6b-8aa3-84d7e45569ad'}]

on python2

[{'status': 'ACTIVE', 'ipsec_site_connections': {u'7e14400a-60df-48d8
-91aa-ec97749555fc': {'status': 'ACTIVE', 'updated_pending_status':
False}}, 'updated_pending_status': False, 'id': u'c903732e-
67da-4363-baf1-0cdcb7476ee7'}, {'status': 'ACTIVE',
'ipsec_site_connections': {u'70671513-e0cf-4bdf-845e-cb6ef084baea':
{'status': 'ACTIVE', 'updated_pending_status': True}},
'updated_pending_status': True, 'id': u'995ed22c-
00c3-4496-b590-b84787ba6caa'}]

Notice uid in ipsec_site_connections. Problem is that this uid is parsed
from subprocess and on python3 this subprocess return bytes instead of
string. Because of this whole output parsing i kind of screw up.

We was able to fix this issue via patching netns_wrapper:


diff --git a/neutron_vpnaas/services/vpn/common/netns_wrapper.py 
b/neutron_vpnaas/services/vpn/common/netns_wrapper.py
index 77378dcc7..35614a717 100644
--- a/neutron_vpnaas/services/vpn/common/netns_wrapper.py
+++ b/neutron_vpnaas/services/vpn/common/netns_wrapper.py
@@ -23,6 +23,7 @@ from neutron.common import utils
 from oslo_config import cfg
 from oslo_log import log as logging
 from oslo_rootwrap import wrapper
+from neutron_lib.utils import helpers
 import six
 
 from neutron_vpnaas._i18n import _
@@ -67,6 +68,8 @@ def execute(cmd):
                                  env=env)
 
     _stdout, _stderr = obj.communicate()
+    _stdout = helpers.safe_decode_utf8(_stdout)
+    _stderr = helpers.safe_decode_utf8(_stderr)
     msg = ('Command: %(cmd)s Exit code: %(returncode)s '
            'Stdout: %(stdout)s Stderr: %(stderr)s' %
            {'cmd': cmd,

** Affects: neutron
     Importance: Undecided
         Status: New


** Tags: python3

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1794718

Title:
  Neutron VPNAAS don't update site connections on python3

Status in neutron:
  New

Bug description:
  Tested with StrongSwan but I hope this can cause issues on others
  drivers too.

  On python3 when new connection is created it's stuck in PENDING_CREATE
  state. Everything is working but connection state is never updated.
  Main reason is that agent send wrong id to server. On python3 message
  look like this:

  [{'updated_pending_status': False, 'ipsec_site_connections': {'a':
  {'updated_pending_status': False, 'status': 'ACTIVE'}}, 'status':
  'ACTIVE', 'id': 'a621a382-308d-4cd0-be0a-01c757064a13'},
  {'updated_pending_status': False, 'ipsec_site_connections': {'a':
  {'updated_pending_status': False, 'status': 'ACTIVE'}}, 'status':
  'ACTIVE', 'id': 'd004c466-cc36-4b6b-8aa3-84d7e45569ad'}]

  on python2

  [{'status': 'ACTIVE', 'ipsec_site_connections': {u'7e14400a-60df-48d8
  -91aa-ec97749555fc': {'status': 'ACTIVE', 'updated_pending_status':
  False}}, 'updated_pending_status': False, 'id': u'c903732e-
  67da-4363-baf1-0cdcb7476ee7'}, {'status': 'ACTIVE',
  'ipsec_site_connections': {u'70671513-e0cf-4bdf-845e-cb6ef084baea':
  {'status': 'ACTIVE', 'updated_pending_status': True}},
  'updated_pending_status': True, 'id': u'995ed22c-
  00c3-4496-b590-b84787ba6caa'}]

  Notice uid in ipsec_site_connections. Problem is that this uid is
  parsed from subprocess and on python3 this subprocess return bytes
  instead of string. Because of this whole output parsing i kind of
  screw up.

  We was able to fix this issue via patching netns_wrapper:

  
  diff --git a/neutron_vpnaas/services/vpn/common/netns_wrapper.py 
b/neutron_vpnaas/services/vpn/common/netns_wrapper.py
  index 77378dcc7..35614a717 100644
  --- a/neutron_vpnaas/services/vpn/common/netns_wrapper.py
  +++ b/neutron_vpnaas/services/vpn/common/netns_wrapper.py
  @@ -23,6 +23,7 @@ from neutron.common import utils
   from oslo_config import cfg
   from oslo_log import log as logging
   from oslo_rootwrap import wrapper
  +from neutron_lib.utils import helpers
   import six
   
   from neutron_vpnaas._i18n import _
  @@ -67,6 +68,8 @@ def execute(cmd):
                                    env=env)
   
       _stdout, _stderr = obj.communicate()
  +    _stdout = helpers.safe_decode_utf8(_stdout)
  +    _stderr = helpers.safe_decode_utf8(_stderr)
       msg = ('Command: %(cmd)s Exit code: %(returncode)s '
              'Stdout: %(stdout)s Stderr: %(stderr)s' %
              {'cmd': cmd,

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1794718/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to