r75400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75399‎ | r75400 | r75401 >
Date:23:45, 25 October 2010
Author:laner
Status:deferred
Tags:
Comment:
Removing hard-coded server info and test admin credentials, and making them globals
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackManager.php (modified) (history)
  • /trunk/extensions/OpenStackManager/OpenStackNovaController.php (modified) (history)
  • /trunk/extensions/OpenStackManager/SpecialCreateInstance.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/SpecialCreateInstance.php
@@ -4,9 +4,10 @@
55 var $adminNova, $userNova;
66
77 function __construct() {
 8+ global $wgOpenStackManagerNovaAdminKeys;
89 parent::__construct( 'OpenStackCreateInstance' );
910 wfLoadExtensionMessages('OpenStackManager');
10 - $credentials = array( 'accessKey' => 'ced15cc2-3181-487b-bd06-f6ed176e3db7:admin', 'secretKey' => 'f3b1a6bb-2812-4eaa-9818-d3693663a800' );
 11+ $credentials = $wgOpenStackManagerNovaAdminKeys;
1112 $this->adminNova = new OpenStackNovaController( $credentials );
1213
1314 }
Index: trunk/extensions/OpenStackManager/OpenStackNovaController.php
@@ -10,11 +10,14 @@
1111
1212 # TODO: Make disable_ssl, hostname, and resource_prefix config options
1313 function __construct( $credentials ) {
 14+ global $wgOpenStackManagerNovaDisableSSL, $wgOpenStackManagerNovaPort,
 15+ $wgOpenStackManagerNovaServerName, $wgOpenStackManagerNovaPort,
 16+ $wgOpenStackManagerNovaResourcePrefix;
1417 wfLoadExtensionMessages('OpenStackManager');
1518 $this->novaConnection = new AmazonEC2( $credentials['accessKey'], $credentials['secretKey'] );
16 - $this->novaConnection->disable_ssl(true);
17 - $this->novaConnection->set_hostname('controller', 8773);
18 - $this->novaConnection->set_resource_prefix('/services/Cloud/');
 19+ $this->novaConnection->disable_ssl($wgOpenStackManagerNovaDisableSSL);
 20+ $this->novaConnection->set_hostname($wgOpenStackManagerNovaServerName, $wgOpenStackManagerNovaPort);
 21+ $this->novaConnection->set_resource_prefix($wgOpenStackManagerNovaResourcePrefix);
1922 $this->instances = Array();
2023 }
2124
Index: trunk/extensions/OpenStackManager/OpenStackManager.php
@@ -25,6 +25,11 @@
2626 'descriptionmsg' => 'openstackmanager-desc',
2727 );
2828
 29+$wgOpenStackManagerNovaDisableSSL = true;
 30+$wgOpenStackManagerNovaServerName = 'localhost';
 31+$wgOpenStackManagerNovaPort = 8773;
 32+$wgOpenStackManagerNovaResourcePrefix = '/services/Cloud/';
 33+
2934 $dir = dirname(__FILE__) . '/';
3035
3136 $wgExtensionMessagesFiles['OpenStackManager'] = $dir . 'OpenStackManager.i18n.php';

Status & tagging log