Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

293.remove usage of deprecated #307

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
# Unreleased

### Fixed
- Avoid use of deprecated methods internally (Issue
[#239](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/239))
- Emit deprecation warnings from deprecated methods (Issue
[#239](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/239))
- Add Facility Port to allow adding multiple interfaces (Issue [#289](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/289))
Expand Down
26 changes: 0 additions & 26 deletions fabrictestbed_extensions/fablib/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,32 +259,6 @@ def list_interfaces(
fields=fields, output=output, quiet=quiet, filter_function=filter_function
)

# def list_interfaces(self) -> List[str]:
# """
# Creates a tabulated string describing all components in the slice.
#
# Intended for printing a list of all components.
#
# :return: Tabulated srting of all components information
# :rtype: String
# """
# table = []
# for iface in self.get_interfaces():
# network_name = ""
# if iface.get_network():
# network_name = iface.get_network().get_name()
#
# table.append( [ iface.get_name(),
# network_name,
# iface.get_bandwidth(),
# iface.get_vlan(),
# iface.get_mac(),
# iface.get_physical_os_interface_name(),
# iface.get_os_interface(),
# ] )
#
# return tabulate(table, headers=["Name", "Network", "Bandwidth", "VLAN", "MAC", "Physical OS Interface", "OS Interface" ])

@staticmethod
def calculate_name(node: Node = None, name: str = None) -> str:
"""
Expand Down
12 changes: 6 additions & 6 deletions fabrictestbed_extensions/fablib/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def __str__(self):
["VLAN", self.get_vlan()],
["MAC", self.get_mac()],
["Physical Device", self.get_physical_os_interface_name()],
["Device", self.get_os_interface()],
["Device", self.get_device_name()],
["Address", self.get_ip_addr()],
["Numa Node", self.get_numa_node()],
]
Expand Down Expand Up @@ -178,7 +178,7 @@ def toDict(self, skip=[]):
if self.get_node() and str(self.get_node().get_reservation_state()) == "Active":
mac = str(self.get_mac())
physical_dev = str(self.get_physical_os_interface_name())
dev = str(self.get_os_interface())
dev = str(self.get_device_name())
ip_addr = str(self.get_ip_addr())
else:
mac = ""
Expand Down Expand Up @@ -719,7 +719,7 @@ def get_ip_link(self):

links = json.loads(stdout)

dev = self.get_os_interface()
dev = self.get_device_name()
if dev == None:
return links

Expand All @@ -733,7 +733,7 @@ def get_ip_link(self):
def get_ip_addr_show(self, dev=None):
try:
if not dev:
dev = self.get_os_interface()
dev = self.get_device_name()

stdout, stderr = self.get_node().execute(
f"ip -j addr show {dev}", quiet=True
Expand All @@ -757,7 +757,7 @@ def get_ip_addr_ssh(self, dev=None):

addrs = json.loads(stdout)

dev = self.get_os_interface()
dev = self.get_device_name()
# print(f"dev: {dev}")

if dev is None:
Expand All @@ -782,7 +782,7 @@ def get_ips(self, family=None):
"""
return_ips = []
try:
dev = self.get_os_interface()
dev = self.get_device_name()

ip_addr = self.get_ip_addr()

Expand Down
4 changes: 1 addition & 3 deletions fabrictestbed_extensions/fablib/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,7 @@ def list_interfaces(
iface.get_physical_os_interface_name
)

logging.info(
f"Starting get get_os_interface_threads for iface {iface.get_name()} "
)
logging.info(f"Starting get get_device_name for iface {iface.get_name()} ")
os_interface_threads[iface.get_name()] = executor.submit(
iface.get_device_name
)
Expand Down
Loading