Andrew Bogott has uploaded a new change for review.

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


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

Sometimes we search for nonexistent hosts; be polite.

Previouslt 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(-)


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

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: newchange
Gerrit-Change-Id: I9e9bdc646b4d1aaea66e14b28326425b2d74ec70
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenStackManager
Gerrit-Branch: master
Gerrit-Owner: Andrew Bogott <[email protected]>

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

Reply via email to