r99998 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99997‎ | r99998 | r99999 >
Date:22:41, 16 October 2011
Author:laner
Status:deferred
Tags:
Comment:
Make security groups unique
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackNovaController.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/OpenStackNovaController.php
@@ -165,10 +165,10 @@
166166 * @param $groupname
167167 * @return OpenStackNovaSecurityGroup
168168 */
169 - function getSecurityGroup( $groupname ) {
 169+ function getSecurityGroup( $groupname, $project ) {
170170 $this->getSecurityGroups();
171 - if ( isset( $this->securityGroups["$groupname"] ) ) {
172 - return $this->securityGroups["$groupname"];
 171+ if ( isset( $this->securityGroups["$project-$groupname"] ) ) {
 172+ return $this->securityGroups["$project-$groupname"];
173173 } else {
174174 return null;
175175 }
@@ -183,8 +183,9 @@
184184 $securityGroups = $securityGroups->body->securityGroupInfo->item;
185185 foreach ( $securityGroups as $securityGroup ) {
186186 $securityGroup = new OpenStackNovaSecurityGroup( $securityGroup );
 187+ $project = $securityGroup->getOwner();
187188 $groupname = $securityGroup->getGroupName();
188 - $this->securityGroups["$groupname"] = $securityGroup;
 189+ $this->securityGroups["$project-$groupname"] = $securityGroup;
189190 }
190191 return $this->securityGroups;
191192 }

Status & tagging log