coren has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/258488

Change subject: OpenStackManager: remove obsolete isVirtual() handling
......................................................................

OpenStackManager: remove obsolete isVirtual() handling

That legacy code was transitional from an old way of doing
project groups that does not exist any more and can never be
active again.

Cleanup to simplify the fixes required by the change to
slapd.

Bug: T121064
Change-Id: Id621acc864f75f9406dfe830bb1adff28628a55c
---
M nova/OpenStackNovaProject.php
M nova/OpenStackNovaProjectGroup.php
2 files changed, 8 insertions(+), 29 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenStackManager 
refs/changes/88/258488/1

diff --git a/nova/OpenStackNovaProject.php b/nova/OpenStackNovaProject.php
index e4936a3..366f158 100644
--- a/nova/OpenStackNovaProject.php
+++ b/nova/OpenStackNovaProject.php
@@ -134,20 +134,15 @@
 
                // If we couldn't find an corresponding Project Group,
                // then we should create one now.
-               if ( !$this->projectGroup->loaded or 
$this->projectGroup->isVirtual() ) {
-                       $wgAuth->printDebug( 
$this->projectGroup->getProjectGroupName() . " either does not exist or is a 
virtual static group.  Recreating is as a real group and syncing members.", 
NONSENSITIVE );
+               if ( !$this->projectGroup->loaded ) {
+                       $wgAuth->printDebug( 
$this->projectGroup->getProjectGroupName() . " does not exist.  Creating it.", 
NONSENSITIVE );
 
-                       // Delete, recreate, and then sync the members.
-                       $deleteSuccess = 
OpenStackNovaProjectGroup::deleteProjectGroup( $this->projectname );
-                       // if we successfully deleted the ProjectGroup, then 
recreate it now.
-                       if ( $deleteSuccess ) {
-                               $createSuccess = 
OpenStackNovaProjectGroup::createProjectGroup( $this->projectname );
-                               // Aaaaand if we successfully created the 
group, then finally sync the members from this project now.
-                               if ( $createSuccess ) {
-                                       $this->projectGroup = new 
OpenStackNovaProjectGroup( $this->projectname );
-                                       $this->syncProjectGroupMembers();
-                               }
-                       }
+            $createSuccess = OpenStackNovaProjectGroup::createProjectGroup( 
$this->projectname );
+            // Aaaaand if we successfully created the group, then finally sync 
the members from this project now.
+            if ( $createSuccess ) {
+                $this->projectGroup = new OpenStackNovaProjectGroup( 
$this->projectname );
+                $this->syncProjectGroupMembers();
+            }
                }
        }
 
diff --git a/nova/OpenStackNovaProjectGroup.php 
b/nova/OpenStackNovaProjectGroup.php
index 9d4a80b..d533842 100644
--- a/nova/OpenStackNovaProjectGroup.php
+++ b/nova/OpenStackNovaProjectGroup.php
@@ -77,22 +77,6 @@
        }
 
        /**
-        * Returns true if this ProjectGroup is a
-        * 'ds-virtual-static-group', meaning that
-        * it doesn't really have any member
-        * attributes of its own.
-        *
-        * Virtual static groups were the previous
-        * way of associating projects with posix groups.
-        * We now manually keep the list of members in sync
-        * when they are added and removed from a Project.
-        */
-       function isVirtual() {
-               $this->fetchProjectGroupInfo(false);
-               return ( array_search( 'ds-virtual-static-group', 
$this->projectGroupInfo[0]['objectclass'] ) !== false );
-       }
-
-       /**
         * Return all users who are a member of this project
         *
         * @return array

-- 
To view, visit https://gerrit.wikimedia.org/r/258488
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id621acc864f75f9406dfe830bb1adff28628a55c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenStackManager
Gerrit-Branch: master
Gerrit-Owner: coren <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to