Ryan Lane has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/64868


Change subject: Fix security group fetching from nova api
......................................................................

Fix security group fetching from nova api

Change-Id: Ia21387c3a2544ca1d255dce8acddb2c448a016cc
---
M nova/OpenStackNovaInstance.php
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenStackManager 
refs/changes/68/64868/1

diff --git a/nova/OpenStackNovaInstance.php b/nova/OpenStackNovaInstance.php
index 3e26cad..2a6e6e8 100644
--- a/nova/OpenStackNovaInstance.php
+++ b/nova/OpenStackNovaInstance.php
@@ -206,12 +206,12 @@
         * @return array
         */
        function getSecurityGroups() {
-               // Currently not implemented in the OpenStack API, so we're
-               // implementing it as metadata for now
-               $secgroup = OpenStackNovaController::_get_property( 
$this->instance->metadata, 'secgroup' );
+               $secgroups = OpenStackNovaController::_get_property( 
$this->instance, 'security_groups' );
                $groups = array();
-               if ( $secgroup ) {
-                       $groups = explode( ',', $secgroup );
+               if ( $secgroups ) {
+                       foreach ( $secgroups as $secgroup ) {
+                               $groups[] = 
OpenStackNovaController::_get_property( $secgroup, 'name' );
+                       }
                }
                return $groups;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/64868
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia21387c3a2544ca1d255dce8acddb2c448a016cc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenStackManager
Gerrit-Branch: master
Gerrit-Owner: Ryan Lane <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to