Changeset 865
- Timestamp:
- 05/15/13 22:12:44 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/web/addons/job_monarch/libtoga.php
r836 r865 707 707 function makeHostname( $thostname, $tdomain=null ) 708 708 { 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; 743 714 } 744 715 else 745 716 { 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; 751 726 } 752 727 … … 990 965 { 991 966 $host = $node. '.'.$domain; 992 } else 967 } 968 else 993 969 { 994 970 $host = $node;
Note: See TracChangeset
for help on using the changeset viewer.