r81202 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81201‎ | r81202 | r81203 >
Date:07:43, 30 January 2011
Author:reedy
Status:deferred
Tags:
Comment:
Don't use @ for error suppression

Define a few variables
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackNovaController.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php (modified) (history)
  • /trunk/extensions/OpenStackManager/special/SpecialNovaKey.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/special/SpecialNovaDomain.php
@@ -19,7 +19,7 @@
2020 $this->notLoggedIn();
2121 return false;
2222 }
23 - $project = $wgRequest->getText( 'project' );
 23+ //$project = $wgRequest->getText( 'project' );
2424 # Must be in the global role
2525 if ( ! $this->userLDAP->inRole( 'netadmin' ) ) {
2626 $this->notInRole( 'netadmin' );
Index: trunk/extensions/OpenStackManager/special/SpecialNovaKey.php
@@ -37,6 +37,7 @@
3838 global $wgRequest, $wgOut;
3939 global $wgOpenStackManagerNovaKeypairStorage;
4040
 41+ $project = '';
4142 if ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) {
4243 $project = $wgRequest->getVal( 'project' );
4344 if ( $project && ! $this->userLDAP->inProject( $project ) ) {
@@ -97,6 +98,8 @@
9899 $wgOut->setPagetitle( wfMsg( 'openstackmanager-deletekey' ) );
99100
100101 $keyInfo = array();
 102+ $hash = '';
 103+ $keypairs = array();
101104
102105 if ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) {
103106 $keyname = $wgRequest->getVal( 'keyname' );
Index: trunk/extensions/OpenStackManager/OpenStackNovaController.php
@@ -200,8 +200,10 @@
201201 if ( $wgOpenStackManagerInstanceUserData['scripts'] ) {
202202 $i = 0;
203203 foreach ( $wgOpenStackManagerInstanceUserData['scripts'] as $script ) {
204 - $stat = @stat( $script );
205 - if ( ! $stat ) {
 204+ wfSuppressWarnings();
 205+ $stat = stat( $script );
 206+ wfRestoreWarnings();
 207+ if ( $stat ) {
206208 continue;
207209 }
208210 $scripttext = file_get_contents( $script );
@@ -213,7 +215,9 @@
214216 if ( $wgOpenStackManagerInstanceUserData['upstarts'] ) {
215217 $i = 0;
216218 foreach ( $wgOpenStackManagerInstanceUserData['upstarts'] as $upstart ) {
217 - $stat = @stat( $upstart );
 219+ wfSuppressWarnings();
 220+ $stat = stat( $upstart );
 221+ wfRestoreWarnings();
218222 if ( ! $stat ) {
219223 continue;
220224 }

Status & tagging log