jenkins-bot has submitted this change and it was merged.

Change subject: Sometimes we search for nonexistent hosts; be polite.
......................................................................


Sometimes we search for nonexistent hosts; be polite.

Previously fetchHostInfo() forged ahead even when it failed
to find a domain for a given instanceid.  That's silly, we should
just assume the instance doesn't exist and return.

Change-Id: I9e9bdc646b4d1aaea66e14b28326425b2d74ec70
---
M nova/OpenStackNovaHost.php
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Ryan Lane: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/nova/OpenStackNovaHost.php b/nova/OpenStackNovaHost.php
index c9b9a9e..e1bfbc4 100644
--- a/nova/OpenStackNovaHost.php
+++ b/nova/OpenStackNovaHost.php
@@ -65,7 +65,13 @@
 
                $this->instanceid = $wgAuth->getLdapEscapedString( 
$this->instanceid );
                if ( $this->private ) {
-                       $fqdn = $this->instanceid . '.' . 
$this->getDomain()->getFullyQualifiedDomainName();
+                       if ($this->getDomain()) {
+                               $fqdn = $this->instanceid . '.' . 
$this->getDomain()->getFullyQualifiedDomainName();
+                       } else {
+                               # No domain means no instance!
+                               $this->hostInfo = null;
+                               return;
+                       }
                        $result = LdapAuthenticationPlugin::ldap_search( 
$wgAuth->ldapconn, $wgOpenStackManagerLDAPInstanceBaseDN, '(dc=' . $fqdn . '))' 
);
                } else {
                        $this->ip = $wgAuth->getLdapEscapedString( $this->ip );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9e9bdc646b4d1aaea66e14b28326425b2d74ec70
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/OpenStackManager
Gerrit-Branch: master
Gerrit-Owner: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Ryan Lane <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to