r100479 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100478‎ | r100479 | r100480 >
Date:00:18, 22 October 2011
Author:laner
Status:deferred
Tags:
Comment:
Make security groups show up in a unique way and use a more succinct description for end and begin ports.
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackManager.i18n.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/special/SpecialNovaSecurityGroup.php
@@ -109,9 +109,9 @@
110110 $wgOut->setPagetitle( wfMsg( 'openstackmanager-configuresecuritygroup' ) );
111111
112112 $securitygroupname = $wgRequest->getText( 'groupname' );
113 - $securitygroup = $this->adminNova->getSecurityGroup( $securitygroupname );
 113+ $project = $wgRequest->getText( 'project' );
 114+ $securitygroup = $this->adminNova->getSecurityGroup( $securitygroupname, $project );
114115 $description = $securitygroup->getGroupDescription();
115 - $project = $wgRequest->getText( 'project' );
116116 if ( ! $this->userLDAP->inRole( 'netadmin', $project ) ) {
117117 $this->notInRole( 'netadmin' );
118118 return false;
@@ -512,7 +512,7 @@
513513 $project = $formData['project'];
514514 $userCredentials = $this->userLDAP->getCredentials( $project );
515515 $this->userNova = new OpenStackNovaController( $userCredentials );
516 - $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'] );
 516+ $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'], $project );
517517 if ( !$securitygroup ) {
518518 $wgOut->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' );
519519 return true;
@@ -541,9 +541,10 @@
542542 function tryConfigureSubmit( $formData, $entryPoint = 'internal' ) {
543543 global $wgOut;
544544
 545+ $project = $formData['project'];
545546 $groupname = $formData['groupname'];
546547 $description = $formData['description'];
547 - $group = $this->adminNova->getSecurityGroup( $groupname );
 548+ $group = $this->adminNova->getSecurityGroup( $groupname, $project );
548549 if ( $group ) {
549550 # This isn't a supported function in the API for now. Leave this action out for now
550551 $success = $this->userNova->modifySecurityGroup( $groupname, array( 'description' => $description ) );
@@ -587,7 +588,7 @@
588589 }
589590 $userCredentials = $this->userLDAP->getCredentials( $project );
590591 $this->userNova = new OpenStackNovaController( $userCredentials );
591 - $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'] );
 592+ $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'], $project );
592593 if ( ! $securitygroup ) {
593594 $wgOut->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' );
594595 return false;
@@ -635,7 +636,7 @@
636637 }
637638 $userCredentials = $this->userLDAP->getCredentials( $project );
638639 $this->userNova = new OpenStackNovaController( $userCredentials );
639 - $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'] );
 640+ $securitygroup = $this->adminNova->getSecurityGroup( $formData['groupname'], $project );
640641 if ( ! $securitygroup ) {
641642 $wgOut->addWikiMsg( 'openstackmanager-nonexistantsecuritygroup' );
642643 return false;
Index: trunk/extensions/OpenStackManager/OpenStackManager.i18n.php
@@ -248,8 +248,8 @@
249249 'openstackmanager-deletesecuritygroup-confirm' => 'Are you sure you would like to delete $1?',
250250 'openstackmanager-securitygrouplist' => 'Security group list',
251251 'openstackmanager-securitygrouprule' => 'Rules',
252 - 'openstackmanager-securitygrouprule-toport' => 'To port',
253 - 'openstackmanager-securitygrouprule-fromport' => 'From port',
 252+ 'openstackmanager-securitygrouprule-toport' => 'End of port range',
 253+ 'openstackmanager-securitygrouprule-fromport' => 'Beginning of port range',
254254 'openstackmanager-securitygrouprule-protocol' => 'Protocol',
255255 'openstackmanager-securitygrouprule-ipranges' => 'CIDR ranges',
256256 'openstackmanager-securitygrouprule-groups' => 'Source group',

Status & tagging log