Index: trunk/extensions/OpenStackManager/SpecialCreateInstance.php |
— | — | @@ -9,7 +9,6 @@ |
10 | 10 | wfLoadExtensionMessages('OpenStackManager'); |
11 | 11 | $credentials = $wgOpenStackManagerNovaAdminKeys; |
12 | 12 | $this->adminNova = new OpenStackNovaController( $credentials ); |
13 | | - |
14 | 13 | } |
15 | 14 | |
16 | 15 | function execute( $par ) { |
— | — | @@ -90,14 +89,21 @@ |
91 | 90 | $instanceForm = new OpenStackCreateInstanceForm( $instanceInfo, 'openstackmanager-form' ); |
92 | 91 | $instanceForm->setTitle( SpecialPage::getTitleFor( 'OpenStackCreateInstance' )); |
93 | 92 | $instanceForm->setSubmitID( 'openstackmanager-form-createinstancesubmit' ); |
94 | | - $instanceForm->setSubmitCallback( array( 'OpenStackCreateInstance', 'tryCreateSubmit' ) ); |
| 93 | + $instanceForm->setSubmitCallback( array( $this, 'tryCreateSubmit' ) ); |
95 | 94 | $instanceForm->show(); |
96 | 95 | |
97 | 96 | } |
98 | 97 | |
99 | 98 | function tryCreateSubmit( $formData, $entryPoint = 'internal' ) { |
100 | 99 | 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 | + |
102 | 108 | return true; |
103 | 109 | } |
104 | 110 | } |