← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1378756] [NEW] set_context in L3NatTestCaseMixin.floatingip_with_assoc not work

 

Public bug reported:

We have following code in
neutron.test.unit.L3NatTestCaseMixin.floatingip_with_assoc get
"set_context" from external but not use it.

    @contextlib.contextmanager
    def floatingip_with_assoc(self, port_id=None, fmt=None, fixed_ip=None,

    ######################################
                              set_context=False):                                                 # <---- We get set_context here
    ######################################

        with self.subnet(cidr='11.0.0.0/24') as public_sub:
            self._set_net_external(public_sub['subnet']['network_id'])
            private_port = None
            if port_id:
                private_port = self._show('ports', port_id)
            with test_db_plugin.optional_ctx(private_port,
                                             self.port) as private_port:
                with self.router() as r:
                    sid = private_port['port']['fixed_ips'][0]['subnet_id']
                    private_sub = {'subnet': {'id': sid}}
                    floatingip = None

                    self._add_external_gateway_to_router(
                        r['router']['id'],
                        public_sub['subnet']['network_id'])
                    self._router_interface_action(
                        'add', r['router']['id'],
                        private_sub['subnet']['id'], None)

                    floatingip = self._make_floatingip(
                        fmt or self.fmt,
                        public_sub['subnet']['network_id'],
                        port_id=private_port['port']['id'],
                        fixed_ip=fixed_ip,

    ######################################
                        set_context=False)                                                    ### <---- But we don't really use it
    ######################################

                    yield floatingip

** Affects: neutron
     Importance: Undecided
         Status: New

** Description changed:

  We have following code in
  neutron.test.unit.L3NatTestCaseMixin.floatingip_with_assoc get
  "set_context" from external but not use it.
  
-     @contextlib.contextmanager
-     def floatingip_with_assoc(self, port_id=None, fmt=None, fixed_ip=None,
-                               set_context=False):                                                 <---- We get set_context here
-         with self.subnet(cidr='11.0.0.0/24') as public_sub:
-             self._set_net_external(public_sub['subnet']['network_id'])
-             private_port = None
-             if port_id:
-                 private_port = self._show('ports', port_id)
-             with test_db_plugin.optional_ctx(private_port,
-                                              self.port) as private_port:
-                 with self.router() as r:
-                     sid = private_port['port']['fixed_ips'][0]['subnet_id']
-                     private_sub = {'subnet': {'id': sid}}
-                     floatingip = None
  
-                     self._add_external_gateway_to_router(
-                         r['router']['id'],
-                         public_sub['subnet']['network_id'])
-                     self._router_interface_action(
-                         'add', r['router']['id'],
-                         private_sub['subnet']['id'], None)
+     @contextlib.contextmanager
+     def floatingip_with_assoc(self, port_id=None, fmt=None, fixed_ip=None,
+                               set_context=False):                                                 <---- We get set_context here
+         with self.subnet(cidr='11.0.0.0/24') as public_sub:
+             self._set_net_external(public_sub['subnet']['network_id'])
+             private_port = None
+             if port_id:
+                 private_port = self._show('ports', port_id)
+             with test_db_plugin.optional_ctx(private_port,
+                                              self.port) as private_port:
+                 with self.router() as r:
+                     sid = private_port['port']['fixed_ips'][0]['subnet_id']
+                     private_sub = {'subnet': {'id': sid}}
+                     floatingip = None
  
-                     floatingip = self._make_floatingip(
-                         fmt or self.fmt,
-                         public_sub['subnet']['network_id'],
-                         port_id=private_port['port']['id'],
-                         fixed_ip=fixed_ip,
-                         set_context=False)                                                     <---- But we don't really use it
-                     yield floatingip
+                     self._add_external_gateway_to_router(
+                         r['router']['id'],
+                         public_sub['subnet']['network_id'])
+                     self._router_interface_action(
+                         'add', r['router']['id'],
+                         private_sub['subnet']['id'], None)
+ 
+                     floatingip = self._make_floatingip(
+                         fmt or self.fmt,
+                         public_sub['subnet']['network_id'],
+                         port_id=private_port['port']['id'],
+                         fixed_ip=fixed_ip,
+                         set_context=False)                                                     <---- But we don't really use it
+                     yield floatingip

** Description changed:

  We have following code in
  neutron.test.unit.L3NatTestCaseMixin.floatingip_with_assoc get
  "set_context" from external but not use it.
  
- 
      @contextlib.contextmanager
      def floatingip_with_assoc(self, port_id=None, fmt=None, fixed_ip=None,
-                               set_context=False):                                                 <---- We get set_context here
+                               set_context=False):                                                 ### <---- We get set_context here
          with self.subnet(cidr='11.0.0.0/24') as public_sub:
              self._set_net_external(public_sub['subnet']['network_id'])
              private_port = None
              if port_id:
                  private_port = self._show('ports', port_id)
              with test_db_plugin.optional_ctx(private_port,
                                               self.port) as private_port:
                  with self.router() as r:
                      sid = private_port['port']['fixed_ips'][0]['subnet_id']
                      private_sub = {'subnet': {'id': sid}}
                      floatingip = None
  
                      self._add_external_gateway_to_router(
                          r['router']['id'],
                          public_sub['subnet']['network_id'])
                      self._router_interface_action(
                          'add', r['router']['id'],
                          private_sub['subnet']['id'], None)
  
                      floatingip = self._make_floatingip(
                          fmt or self.fmt,
                          public_sub['subnet']['network_id'],
                          port_id=private_port['port']['id'],
                          fixed_ip=fixed_ip,
-                         set_context=False)                                                     <---- But we don't really use it
+                         set_context=False)                                                    ### <---- But we don't really use it
                      yield floatingip

** Description changed:

  We have following code in
  neutron.test.unit.L3NatTestCaseMixin.floatingip_with_assoc get
  "set_context" from external but not use it.
  
      @contextlib.contextmanager
      def floatingip_with_assoc(self, port_id=None, fmt=None, fixed_ip=None,
-                               set_context=False):                                                 ### <---- We get set_context here
+                               set_context=False):                                                 #       ## <---- We get set_context here
          with self.subnet(cidr='11.0.0.0/24') as public_sub:
              self._set_net_external(public_sub['subnet']['network_id'])
              private_port = None
              if port_id:
                  private_port = self._show('ports', port_id)
              with test_db_plugin.optional_ctx(private_port,
                                               self.port) as private_port:
                  with self.router() as r:
                      sid = private_port['port']['fixed_ips'][0]['subnet_id']
                      private_sub = {'subnet': {'id': sid}}
                      floatingip = None
  
                      self._add_external_gateway_to_router(
                          r['router']['id'],
                          public_sub['subnet']['network_id'])
                      self._router_interface_action(
                          'add', r['router']['id'],
                          private_sub['subnet']['id'], None)
  
                      floatingip = self._make_floatingip(
                          fmt or self.fmt,
                          public_sub['subnet']['network_id'],
                          port_id=private_port['port']['id'],
                          fixed_ip=fixed_ip,
                          set_context=False)                                                    ### <---- But we don't really use it
                      yield floatingip

** Description changed:

  We have following code in
  neutron.test.unit.L3NatTestCaseMixin.floatingip_with_assoc get
  "set_context" from external but not use it.
  
      @contextlib.contextmanager
      def floatingip_with_assoc(self, port_id=None, fmt=None, fixed_ip=None,
-                               set_context=False):                                                 #       ## <---- We get set_context here
+                               set_context=False):                                                 ### <---- We get set_context here
          with self.subnet(cidr='11.0.0.0/24') as public_sub:
              self._set_net_external(public_sub['subnet']['network_id'])
              private_port = None
              if port_id:
                  private_port = self._show('ports', port_id)
              with test_db_plugin.optional_ctx(private_port,
                                               self.port) as private_port:
                  with self.router() as r:
                      sid = private_port['port']['fixed_ips'][0]['subnet_id']
                      private_sub = {'subnet': {'id': sid}}
                      floatingip = None
  
                      self._add_external_gateway_to_router(
                          r['router']['id'],
                          public_sub['subnet']['network_id'])
                      self._router_interface_action(
                          'add', r['router']['id'],
                          private_sub['subnet']['id'], None)
  
                      floatingip = self._make_floatingip(
                          fmt or self.fmt,
                          public_sub['subnet']['network_id'],
                          port_id=private_port['port']['id'],
                          fixed_ip=fixed_ip,
                          set_context=False)                                                    ### <---- But we don't really use it
                      yield floatingip

** Description changed:

  We have following code in
  neutron.test.unit.L3NatTestCaseMixin.floatingip_with_assoc get
  "set_context" from external but not use it.
  
      @contextlib.contextmanager
      def floatingip_with_assoc(self, port_id=None, fmt=None, fixed_ip=None,
-                               set_context=False):                                                 ### <---- We get set_context here
+ 
+ ######################################
+                               set_context=False):                                                 # <---- We get set_context here
+ ######################################
+ 
          with self.subnet(cidr='11.0.0.0/24') as public_sub:
              self._set_net_external(public_sub['subnet']['network_id'])
              private_port = None
              if port_id:
                  private_port = self._show('ports', port_id)
              with test_db_plugin.optional_ctx(private_port,
                                               self.port) as private_port:
                  with self.router() as r:
                      sid = private_port['port']['fixed_ips'][0]['subnet_id']
                      private_sub = {'subnet': {'id': sid}}
                      floatingip = None
  
                      self._add_external_gateway_to_router(
                          r['router']['id'],
                          public_sub['subnet']['network_id'])
                      self._router_interface_action(
                          'add', r['router']['id'],
                          private_sub['subnet']['id'], None)
  
                      floatingip = self._make_floatingip(
                          fmt or self.fmt,
                          public_sub['subnet']['network_id'],
                          port_id=private_port['port']['id'],
                          fixed_ip=fixed_ip,
+ 
+ ######################################
                          set_context=False)                                                    ### <---- But we don't really use it
+ ######################################
+ 
                      yield floatingip

** Description changed:

  We have following code in
  neutron.test.unit.L3NatTestCaseMixin.floatingip_with_assoc get
  "set_context" from external but not use it.
  
      @contextlib.contextmanager
      def floatingip_with_assoc(self, port_id=None, fmt=None, fixed_ip=None,
  
- ######################################
+     ######################################
                                set_context=False):                                                 # <---- We get set_context here
- ######################################
+     ######################################
  
          with self.subnet(cidr='11.0.0.0/24') as public_sub:
              self._set_net_external(public_sub['subnet']['network_id'])
              private_port = None
              if port_id:
                  private_port = self._show('ports', port_id)
              with test_db_plugin.optional_ctx(private_port,
                                               self.port) as private_port:
                  with self.router() as r:
                      sid = private_port['port']['fixed_ips'][0]['subnet_id']
                      private_sub = {'subnet': {'id': sid}}
                      floatingip = None
  
                      self._add_external_gateway_to_router(
                          r['router']['id'],
                          public_sub['subnet']['network_id'])
                      self._router_interface_action(
                          'add', r['router']['id'],
                          private_sub['subnet']['id'], None)
  
                      floatingip = self._make_floatingip(
                          fmt or self.fmt,
                          public_sub['subnet']['network_id'],
                          port_id=private_port['port']['id'],
                          fixed_ip=fixed_ip,
  
- ######################################
+     ######################################
                          set_context=False)                                                    ### <---- But we don't really use it
- ######################################
+     ######################################
  
                      yield floatingip

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

Title:
  set_context in L3NatTestCaseMixin.floatingip_with_assoc not work

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  We have following code in
  neutron.test.unit.L3NatTestCaseMixin.floatingip_with_assoc get
  "set_context" from external but not use it.

      @contextlib.contextmanager
      def floatingip_with_assoc(self, port_id=None, fmt=None, fixed_ip=None,

      ######################################
                                set_context=False):                                                 # <---- We get set_context here
      ######################################

          with self.subnet(cidr='11.0.0.0/24') as public_sub:
              self._set_net_external(public_sub['subnet']['network_id'])
              private_port = None
              if port_id:
                  private_port = self._show('ports', port_id)
              with test_db_plugin.optional_ctx(private_port,
                                               self.port) as private_port:
                  with self.router() as r:
                      sid = private_port['port']['fixed_ips'][0]['subnet_id']
                      private_sub = {'subnet': {'id': sid}}
                      floatingip = None

                      self._add_external_gateway_to_router(
                          r['router']['id'],
                          public_sub['subnet']['network_id'])
                      self._router_interface_action(
                          'add', r['router']['id'],
                          private_sub['subnet']['id'], None)

                      floatingip = self._make_floatingip(
                          fmt or self.fmt,
                          public_sub['subnet']['network_id'],
                          port_id=private_port['port']['id'],
                          fixed_ip=fixed_ip,

      ######################################
                          set_context=False)                                                    ### <---- But we don't really use it
      ######################################

                      yield floatingip

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


Follow ups

References