Changeset 865


Ignore:
Timestamp:
05/15/13 22:12:44 (11 years ago)
Author:
ramonb
Message:

libtoga.php:

  • xml parsing finishUp() used different hostname logic
  • fixed: down/offline nodes properly marked in cluster image again
  • closes #165
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/web/addons/job_monarch/libtoga.php

    r836 r865  
    707707    function makeHostname( $thostname, $tdomain=null )
    708708    {
    709         // Should hostname be FQDN or short w/o domain
    710         //
    711         $nodes = &$this->nodes;
    712 
    713         $fqdn = 1;
    714 
    715         //$tdomain = explode( '.', $thostname );
    716         //
    717         // TODO?: extract domain from hostname or something?
    718 
    719         if( $tdomain )
    720         {
    721             $domain_len    = 0 - strlen( $tdomain );
    722 
    723             // Let's see if Ganglia use's FQDN or short hostnames
    724             //
    725             foreach( $nodes as $hostname => $nimage )
    726             {
    727                 if( strpos( $hostname, $tomdain ) !== false )
    728                 {
    729                     $fqdn    = 0;
    730                 }
    731             }
    732         }
    733         else
    734         {
    735             $fqdn    = 0;
    736         }
    737    
    738         if( $tdomain && $fqdn )
    739         {
    740             if( strpos( $thostname, $tdomain ) !== false )
    741             {
    742                 $thostname = $thostname . '.'.$tdomain;
     709        if( $this->fqdn && isset( $tdomain ) )
     710        {
     711            if( strpos( $thostname, $tdomain ) === false )
     712            {
     713                $mhost = $thostname . '.' . $tdomain;
    743714            }
    744715            else
    745716            {
    746                 $thostname = $thostname;
    747             }
    748         }
    749 
    750         return $thostname;
     717                $mhost = $thostname;
     718            }
     719        }
     720        else
     721        {
     722            $mhost = $thostname;
     723        }
     724
     725        return $mhost;
    751726    }
    752727
     
    990965                                {
    991966                                    $host = $node. '.'.$domain;
    992                                 } else
     967                                }
     968                                else
    993969                                {
    994970                                    $host = $node;
Note: See TracChangeset for help on using the changeset viewer.