From d0b2162eb3d3a218283a2bab35f86d9d35d0a496 Mon Sep 17 00:00:00 2001 From: rowan04 Date: Mon, 11 Sep 2023 16:06:30 +0000 Subject: [PATCH] Allow service groups to have multiple scopes, and not just the local scope by default - before each service group was given just the local scope by default - this allows egi scopes to be added - and allows multiple scopes to be added for each service group --- lib/Doctrine/deploy/AddServiceGroups.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/deploy/AddServiceGroups.php b/lib/Doctrine/deploy/AddServiceGroups.php index 8238de7a4..715baf169 100644 --- a/lib/Doctrine/deploy/AddServiceGroups.php +++ b/lib/Doctrine/deploy/AddServiceGroups.php @@ -27,7 +27,7 @@ $desc = ""; $monitored = false; $email = ""; - $scope = "Local"; + $scope = ""; foreach ($st as $key => $value) { if ((string) $key == "NAME") { @@ -47,19 +47,26 @@ if ((string) $key == "CONTACT_EMAIL") { $email = (string) $value; } - - if ((string) $key == "SCOPE") { - $scope = (string) $value; - } } $instance->setName($name); $instance->setDescription($desc); $instance->setMonitored($monitored); $instance->setEmail($email); - $instance->addScope(getScope($entityManager, $scope)); + + // Add the owned scope(s) to the service group + $sc = $st->SCOPES; + // Iterate through each owned scope + foreach ($sc->SCOPE as $sco) { + // Retrieve the scope + $scope = (string) $sco; + + // Add the scope to the service group + $instance->addScope(getScope($entityManager, $scope)); + } // Add the owned services to the service group + // Iterate through each owned service foreach ($st->SERVICE_ENDPOINT as $se) { // Retrieve the service's hostname $seName = (string) $se->HOSTNAME;