r77443 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77442‎ | r77443 | r77444 >
Date:22:35, 29 November 2010
Author:laner
Status:deferred (Comments)
Tags:
Comment:
Fix call to tryCreateSubmit so that it can access nova credentials
Modified paths:
  • /trunk/extensions/OpenStackManager/SpecialCreateInstance.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/SpecialCreateInstance.php
@@ -9,7 +9,6 @@
1010 wfLoadExtensionMessages('OpenStackManager');
1111 $credentials = $wgOpenStackManagerNovaAdminKeys;
1212 $this->adminNova = new OpenStackNovaController( $credentials );
13 -
1413 }
1514
1615 function execute( $par ) {
@@ -90,14 +89,21 @@
9190 $instanceForm = new OpenStackCreateInstanceForm( $instanceInfo, 'openstackmanager-form' );
9291 $instanceForm->setTitle( SpecialPage::getTitleFor( 'OpenStackCreateInstance' ));
9392 $instanceForm->setSubmitID( 'openstackmanager-form-createinstancesubmit' );
94 - $instanceForm->setSubmitCallback( array( 'OpenStackCreateInstance', 'tryCreateSubmit' ) );
 93+ $instanceForm->setSubmitCallback( array( $this, 'tryCreateSubmit' ) );
9594 $instanceForm->show();
9695
9796 }
9897
9998 function tryCreateSubmit( $formData, $entryPoint = 'internal' ) {
10099 global $wgOut;
101 -
 100+
 101+ $instanceId = $this->adminNova->createInstance( $formData['imageType'], $formData['keypair'],
 102+ $formData['instanceType'], $formData['availabilityZone'] );
 103+
 104+ print_r($instanceID);
 105+
 106+ $wgOut->addHTML('<p>Created instance ' . $instanceId . '</p>');
 107+
102108 return true;
103109 }
104110 }

Comments

#Comment by Reedy (talk | contribs)   23:03, 29 November 2010
+		print_r($instanceID);

Mmmm, debug :P

#Comment by Ryan lane (talk | contribs)   23:09, 29 November 2010

Gah. That'll teach me to check in something I did last week and didn't look at before commiting :(.

#Comment by Reedy (talk | contribs)   23:13, 29 November 2010

Haha. Casing was wrong too. Check out r77446 :)

#Comment by Ryan lane (talk | contribs)   23:14, 29 November 2010

/me sighs

#Comment by Ryan lane (talk | contribs)   23:13, 29 November 2010

And yes, I realize that the way I'm outputting the instanceId is bad, before anyone gets to that :). The input is coming from the controller, which should be trusted, but I'll ensure I'm outputting it correctly soon.

Status & tagging log