Rush has uploaded a new change for review.
https://gerrit.wikimedia.org/r/258355
Change subject: OSM trying not to create empty groups
......................................................................
OSM trying not to create empty groups
Change-Id: I967343fc7c7426fff7e6ac46dc32a38f228764b0
---
M nova/OpenStackNovaProject.php
M nova/OpenStackNovaProjectGroup.php
2 files changed, 5 insertions(+), 1 deletion(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenStackManager
refs/changes/55/258355/1
diff --git a/nova/OpenStackNovaProject.php b/nova/OpenStackNovaProject.php
index e4936a3..78182eb 100644
--- a/nova/OpenStackNovaProject.php
+++ b/nova/OpenStackNovaProject.php
@@ -135,7 +135,7 @@
// If we couldn't find an corresponding Project Group,
// then we should create one now.
if ( !$this->projectGroup->loaded or
$this->projectGroup->isVirtual() ) {
- $wgAuth->printDebug(
$this->projectGroup->getProjectGroupName() . " either does not exist or is a
virtual static group. Recreating is as a real group and syncing members.",
NONSENSITIVE );
+ $wgAuth->printDebug(
$this->projectGroup->getProjectGroupName() . " either does not exist or is a
virtual static group. Recreating as a real group and syncing members.",
NONSENSITIVE );
// Delete, recreate, and then sync the members.
$deleteSuccess =
OpenStackNovaProjectGroup::deleteProjectGroup( $this->projectname );
diff --git a/nova/OpenStackNovaProjectGroup.php
b/nova/OpenStackNovaProjectGroup.php
index 9d4a80b..9018491 100644
--- a/nova/OpenStackNovaProjectGroup.php
+++ b/nova/OpenStackNovaProjectGroup.php
@@ -251,11 +251,15 @@
static function createProjectGroup( $projectname ) {
global $wgAuth;
global $wgOpenStackManagerLDAPProjectGroupBaseDN;
+ global $wgOpenStackManagerLDAPUsername;
OpenStackNovaLdapConnection::connect();
+ $user = new OpenStackNovaUser( $wgOpenStackManagerLDAPUsername
);
+
$projectGroupName = self::$prefix . $projectname;
$projectGroup = array();
+ $projectGroup['member'][] = $user->userDN;
$projectGroup['objectclass'][] = 'posixgroup';
$projectGroup['objectclass'][] = 'groupofnames';
$projectGroup['cn'] = $projectGroupName;
--
To view, visit https://gerrit.wikimedia.org/r/258355
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I967343fc7c7426fff7e6ac46dc32a38f228764b0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenStackManager
Gerrit-Branch: master
Gerrit-Owner: Rush <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits