Skip to content
Snippets Groups Projects
Commit f83593dd authored by Erik Reid's avatar Erik Reid
Browse files

tmp refactoring of service.ipam

parent bcefba8d
Branches
No related tags found
1 merge request!5Device workflows
......@@ -2,7 +2,7 @@ from orchestrator import OrchestratorCore
from orchestrator.cli.main import app as core_cli
from orchestrator.settings import AppSettings
import geant_service_orchestrator.products # noqa: F401
import geant_service_orchestrator.workflows # noqa: F401
import geant_service_orchestrator.workflows # noqa: F401
app = OrchestratorCore(base_settings=AppSettings())
......
......@@ -2,7 +2,6 @@ import ipaddress
from pydantic import BaseSettings
from geant_service_orchestrator import settings
class ServiceNetworks(BaseSettings):
v4: ipaddress.IPv4Network
v6: ipaddress.IPv6Network
......@@ -14,8 +13,9 @@ class HostAddresses(BaseSettings):
def new_service_networks(
ipam: settings.IPAMParams,
service_params: settings.ServiceNetworkParams) -> ServiceNetworks:
oss = settings.load_oss_params()
assert oss.IPAM.INFOBLOX
# TODO: load from ipam
# cf. https://gitlab.geant.org/goat/gap-jenkins/-/blob/development/service-editor/gap_service_editor/ipam.py#L35-66 # noqa: E501
return ServiceNetworks(
......@@ -23,7 +23,9 @@ def new_service_networks(
v6=ipaddress.IPv6Network('dead:beef::/120'))
def new_device_lo_address(fqdn: str, networks: ServiceNetworks) -> HostAddresses:
def new_device_lo_address() -> HostAddresses:
oss = settings.load_oss_params()
assert oss.IPAM.INFOBLOX
# TODO: load from ipam
return HostAddresses(
v4=ipaddress.IPv4Address('10.10.10.10'),
......
......@@ -45,7 +45,7 @@ def get_info_from_ipam(subscription: device.DeviceInactive) -> State:
lo = ipam.new_device_lo_address()
subscription.device.lo_ipv4_address = lo.v4
subscription.device.lo_ipv6_address = lo.v6
# TODO: get info about how these are to be generated
# TODO: get info about how these should be generated
subscription.device.lo_iso_address = "49.51e5.0001.0620.4009.6047.00"
subscription.device.si_ipv4_network = "192.168.0.0/31"
subscription.device.ias_lt_ipv4_network = "192.168.1.0/31"
......
......@@ -11,7 +11,7 @@ from orchestrator.workflows.steps import (
)
from orchestrator.workflows.utils import wrap_modify_initial_input_form
from products import Device
from geant_service_orchestrator.products.product_types.device import Device
def initial_input_form_generator(subscription_id: UUIDstr) -> InputForm:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment