Users shouldn't use these methods, instead they should use methods from InterfaceAPI, this patch adds decorator to the methods, so each time method is called, warning message is shown in log warning user that the message is deprecated and he should check documentation for up-to-date method
Signed-off-by: Jiri Prochazka jprochaz@redhat.com --- lnst/Controller/Task.py | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py index 5aa0ea1..4cdd3c8 100644 --- a/lnst/Controller/Task.py +++ b/lnst/Controller/Task.py @@ -260,6 +260,7 @@ class HostAPI(object): def get_interface(self, interface_id): return self._interfaces[interface_id]
+ @deprecated def get_devname(self, interface_id): """ Returns devname of the interface. @@ -273,6 +274,7 @@ class HostAPI(object): iface = self._interfaces[interface_id] return iface.get_devname()
+ @deprecated def get_hwaddr(self, interface_id): """ Returns hwaddr of the interface. @@ -303,6 +305,7 @@ class HostAPI(object): iface = self._interfaces[interface_id] return iface.get_ip_addr(addr_number)
+ @deprecated def get_prefix(self, interface_id, addr_number=0): """ Returns an IP address prefix (netmask)
Wed, Aug 26, 2015 at 04:36:26PM CEST, jprochaz@redhat.com wrote:
Users shouldn't use these methods, instead they should use methods from InterfaceAPI, this patch adds decorator to the methods, so each time method is called, warning message is shown in log warning user that the message is deprecated and he should check documentation for up-to-date method
Signed-off-by: Jiri Prochazka jprochaz@redhat.com
lnst/Controller/Task.py | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/lnst/Controller/Task.py b/lnst/Controller/Task.py index 5aa0ea1..4cdd3c8 100644 --- a/lnst/Controller/Task.py +++ b/lnst/Controller/Task.py @@ -260,6 +260,7 @@ class HostAPI(object): def get_interface(self, interface_id): return self._interfaces[interface_id]
- @deprecated def get_devname(self, interface_id): """ Returns devname of the interface.
@@ -273,6 +274,7 @@ class HostAPI(object): iface = self._interfaces[interface_id] return iface.get_devname()
- @deprecated def get_hwaddr(self, interface_id): """ Returns hwaddr of the interface.
@@ -303,6 +305,7 @@ class HostAPI(object): iface = self._interfaces[interface_id] return iface.get_ip_addr(addr_number)
- @deprecated def get_prefix(self, interface_id, addr_number=0): """ Returns an IP address prefix (netmask)
-- 2.4.3
LNST-developers mailing list LNST-developers@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
Acked-by: Jan Tluka jtluka@redhat.com
lnst-developers@lists.fedorahosted.org