jenkins-bot has submitted this change and it was merged.
Change subject: OSM trying not to create empty groups
......................................................................
OSM trying not to create empty groups
The move to openldap has broken project creation
seemingly based on openldap's sane coherence to rfc's
Bug: T121064
Change-Id: Idfe00340555edc11659cb3705368bd61813065d5
(cherry picked from commit c77d206e0ec9d9fc3837249f508070e09aa51af1)
---
M nova/OpenStackNovaProjectGroup.php
1 file changed, 10 insertions(+), 0 deletions(-)
Approvals:
20after4: Looks good to me, approved
jenkins-bot: Verified
diff --git a/nova/OpenStackNovaProjectGroup.php
b/nova/OpenStackNovaProjectGroup.php
index 9d4a80b..ea075fa 100644
--- a/nova/OpenStackNovaProjectGroup.php
+++ b/nova/OpenStackNovaProjectGroup.php
@@ -251,11 +251,20 @@
static function createProjectGroup( $projectname ) {
global $wgAuth;
global $wgOpenStackManagerLDAPProjectGroupBaseDN;
+ global $wgOpenStackManagerLDAPUsername;
OpenStackNovaLdapConnection::connect();
+ $user = new OpenStackNovaUser( $wgOpenStackManagerLDAPUsername
);
+
+ if ( ! $user->userDN ) {
+ $wgAuth->printDebug( "Failed to find userDN in
createProjectGroup", NONSENSITIVE );
+ return false;
+ }
+
$projectGroupName = self::$prefix . $projectname;
$projectGroup = array();
+ $projectGroup['member'][] = $user->userDN;
$projectGroup['objectclass'][] = 'posixgroup';
$projectGroup['objectclass'][] = 'groupofnames';
$projectGroup['cn'] = $projectGroupName;
@@ -269,6 +278,7 @@
}
else {
$wgAuth->printDebug( "Failed to add project group
$projectGroupName: " . ldap_error( $wgAuth->ldapconn ), NONSENSITIVE );
+ return false;
}
return $success;
}
--
To view, visit https://gerrit.wikimedia.org/r/258515
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Idfe00340555edc11659cb3705368bd61813065d5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenStackManager
Gerrit-Branch: wmf/1.27.0-wmf.8
Gerrit-Owner: 20after4 <[email protected]>
Gerrit-Reviewer: 20after4 <[email protected]>
Gerrit-Reviewer: Rush <[email protected]>
Gerrit-Reviewer: coren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits