
from netman.core.objects.interface import BaseInterface


class Bond(BaseInterface):
    def __init__(self, number=None, link_speed=None, members=None, **interface):
        super(Bond, self).__init__(**interface)
        self.number = number
        self.link_speed = link_speed
        self.members = members or []

import warnings

from netman.core.objects.interface import BaseInterface


class Bond(BaseInterface):
    def __init__(self, number=None, link_speed=None, members=None, **interface):
        super(Bond, self).__init__(**interface)
        self.number = number
        self.link_speed = link_speed
        self.members = members or []

    @property
    def interface(self):
        warnings.warn('Deprecated: Use directly the members of Bond instead.',
                      category=DeprecationWarning)
        return self

Support deprecated use of the interface property of Bond.
Support deprecated use of the interface property of Bond.

+ import warnings
  
  from netman.core.objects.interface import BaseInterface
  
  
  class Bond(BaseInterface):
      def __init__(self, number=None, link_speed=None, members=None, **interface):
          super(Bond, self).__init__(**interface)
          self.number = number
          self.link_speed = link_speed
          self.members = members or []
  
+     @property
+     def interface(self):
+         warnings.warn('Deprecated: Use directly the members of Bond instead.',
+                       category=DeprecationWarning)
+         return self
+ 
Support deprecated use of the interface property of Bond.
## Code Before:

from netman.core.objects.interface import BaseInterface


class Bond(BaseInterface):
    def __init__(self, number=None, link_speed=None, members=None, **interface):
        super(Bond, self).__init__(**interface)
        self.number = number
        self.link_speed = link_speed
        self.members = members or []

## Instruction:
Support deprecated use of the interface property of Bond.
## Code After:
import warnings

from netman.core.objects.interface import BaseInterface


class Bond(BaseInterface):
    def __init__(self, number=None, link_speed=None, members=None, **interface):
        super(Bond, self).__init__(**interface)
        self.number = number
        self.link_speed = link_speed
        self.members = members or []

    @property
    def interface(self):
        warnings.warn('Deprecated: Use directly the members of Bond instead.',
                      category=DeprecationWarning)
        return self
