Skip to content

Commit

Permalink
Allow service groups to have multiple scopes, and not just the local …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
rowan04 committed Sep 11, 2023
1 parent 975f7cf commit d0b2162
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/Doctrine/deploy/AddServiceGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
$desc = "";
$monitored = false;
$email = "";
$scope = "Local";
$scope = "";

foreach ($st as $key => $value) {
if ((string) $key == "NAME") {
Expand All @@ -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;
Expand Down

0 comments on commit d0b2162

Please sign in to comment.