Skip to content

Commit

Permalink
Remove methods to get private bastion addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
sajith committed Oct 27, 2023
1 parent 8dd815b commit 1188699
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
52 changes: 0 additions & 52 deletions fabrictestbed_extensions/fablib/fablib.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,28 +334,6 @@ def get_bastion_public_addr() -> str:
"""
return fablib.get_default_fablib_manager().get_bastion_public_addr()

@staticmethod
def get_bastion_private_ipv4_addr() -> str:
"""
Gets the FABRIC Bastion private IPv4 host address. This is the
internally faceing IPv4 address needed to use paramiko
:return: Bastion private IPv4 address
:rtype: String
"""
return fablib.get_default_fablib_manager().get_bastion_private_ipv4_addr()

@staticmethod
def get_bastion_private_ipv6_addr() -> str:
"""
Gets the FABRIC Bastion private IPv6 host address. This is the
internally faceing IPv4 address needed to use paramiko
:return: Bastion private IPv6 address
:rtype: String
"""
return fablib.get_default_fablib_manager().get_bastion_private_ipv6_addr()

@staticmethod
def get_slice_manager() -> SliceManager:
"""
Expand Down Expand Up @@ -528,8 +506,6 @@ class FablibManager:
FABRIC_BASTION_KEY_LOCATION = "FABRIC_BASTION_KEY_LOCATION"
FABRIC_BASTION_HOST = "FABRIC_BASTION_HOST"
FABRIC_BASTION_KEY_PASSWORD = "FABRIC_BASTION_KEY_PASSWORD"
FABRIC_BASTION_HOST_PRIVATE_IPV4 = "FABRIC_BASTION_HOST_PRIVATE_IPV4"
FABRIC_BASTION_HOST_PRIVATE_IPV6 = "FABRIC_BASTION_HOST_PRIVATE_IPV6"
FABRIC_SLICE_PUBLIC_KEY_FILE = "FABRIC_SLICE_PUBLIC_KEY_FILE"
FABRIC_SLICE_PRIVATE_KEY_FILE = "FABRIC_SLICE_PRIVATE_KEY_FILE"
FABRIC_SLICE_PRIVATE_KEY_PASSPHRASE = "FABRIC_SLICE_PRIVATE_KEY_PASSPHRASE"
Expand Down Expand Up @@ -659,11 +635,6 @@ def __init__(
self.bastion_key_filename = os.environ.get(self.FABRIC_BASTION_KEY_LOCATION)
self.bastion_public_addr = os.environ.get(self.FABRIC_BASTION_HOST)

# if self.FABRIC_BASTION_HOST_PRIVATE_IPV4 in os.environ:
# self.bastion_private_ipv4_addr = os.environ[self.FABRIC_BASTION_HOST_PRIVATE_IPV4]
# if self.FABRIC_BASTION_HOST_PRIVATE_IPV6 in os.environ:
# self.bastion_private_ipv6_addr = os.environ[self.FABRIC_BASTION_HOST_PRIVATE_IPV6]

# Slice Keys
if self.FABRIC_SLICE_PUBLIC_KEY_FILE in os.environ:
self.default_slice_key["slice_public_key_file"] = os.environ[
Expand Down Expand Up @@ -781,9 +752,6 @@ def __init__(
# format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s',
# datefmt='%H:%M:%S')

self.bastion_private_ipv4_addr = "0.0.0.0"
self.bastion_private_ipv6_addr = "0:0:0:0:0:0"

self._validate_configuration()

# Create slice manager
Expand Down Expand Up @@ -1631,26 +1599,6 @@ def get_bastion_public_addr(self) -> str:
"""
return self.bastion_public_addr

def get_bastion_private_ipv4_addr(self) -> str:
"""
Gets the FABRIC Bastion private IPv4 host address. This is the
internally faceing IPv4 address needed to use paramiko
:return: Bastion private IPv4 address
:rtype: String
"""
return self.bastion_private_ipv4_addr

def get_bastion_private_ipv6_addr(self) -> str:
"""
Gets the FABRIC Bastion private IPv6 host address. This is the
internally faceing IPv4 address needed to use paramiko
:return: Bastion private IPv6 address
:rtype: String
"""
return self.bastion_private_ipv6_addr

def probe_bastion_host(self) -> bool:
"""
See if bastion will admit us with our configuration.
Expand Down
2 changes: 0 additions & 2 deletions fabrictestbed_extensions/fablib/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,11 +1354,9 @@ def execute(
# Get and test src and management_ips
management_ip = str(self.get_fim_node().get_property(pname="management_ip"))
if self.validIPAddress(management_ip) == "IPv4":
# src_addr = (self.get_fablib_manager().get_bastion_private_ipv4_addr(), 22)
src_addr = ("0.0.0.0", 22)

elif self.validIPAddress(management_ip) == "IPv6":
# src_addr = (self.get_fablib_manager().get_bastion_private_ipv6_addr(), 22)
src_addr = ("0:0:0:0:0:0:0:0", 22)
else:
logging.error("node.execute: Management IP Invalid:", exc_info=True)
Expand Down

0 comments on commit 1188699

Please sign in to comment.