[pve-devel] r5475 - in pve-cluster/trunk/data: . perl

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Feb 2 10:06:37 CET 2011


Author: dietmar
Date: 2011-02-02 10:06:37 +0100 (Wed, 02 Feb 2011)
New Revision: 5475

Modified:
   pve-cluster/trunk/data/ChangeLog
   pve-cluster/trunk/data/perl/Cluster.pm
   pve-cluster/trunk/data/perl/test1.pl
Log:


Modified: pve-cluster/trunk/data/ChangeLog
===================================================================
--- pve-cluster/trunk/data/ChangeLog	2011-02-02 07:48:56 UTC (rev 5474)
+++ pve-cluster/trunk/data/ChangeLog	2011-02-02 09:06:37 UTC (rev 5475)
@@ -1,3 +1,7 @@
+2011-02-02  Proxmox Support Team  <support at proxmox.com>
+
+	* perl/Cluster.pm (remote_node_ip): implement stub
+
 2011-02-01  Proxmox Support Team  <support at proxmox.com>
 
 	* perl/Cluster.pm (cfs_lock_file): first try.

Modified: pve-cluster/trunk/data/perl/Cluster.pm
===================================================================
--- pve-cluster/trunk/data/perl/Cluster.pm	2011-02-02 07:48:56 UTC (rev 5474)
+++ pve-cluster/trunk/data/perl/Cluster.pm	2011-02-02 09:06:37 UTC (rev 5475)
@@ -608,3 +608,20 @@
    syslog("err", "writing cluster log failed: $@") if $@;
 }
 
+sub remote_node_ip {
+    my ($nodename, $noerr) = @_;
+
+    # fixme: get IP from pmxcfs 
+
+
+    # fallback: try to get IP by other means
+    my $packed_ip = gethostbyname($nodename);
+    if (defined $packed_ip) {
+        my $ip = inet_ntoa($packed_ip);
+	return $ip;
+    }
+
+    die "unable to get IP for node '$nodename' - node offline?\n" if !$noerr;
+
+    return undef;
+}

Modified: pve-cluster/trunk/data/perl/test1.pl
===================================================================
--- pve-cluster/trunk/data/perl/test1.pl	2011-02-02 07:48:56 UTC (rev 5474)
+++ pve-cluster/trunk/data/perl/test1.pl	2011-02-02 09:06:37 UTC (rev 5475)
@@ -8,7 +8,7 @@
 
 my $nodename = PVE::INotify::nodename();
 PVE::Cluster::log_msg(1, "ident2", "msg1 öäü");
-print PVE::Cluster::get_cluster_log(undef, 0);
+print PVE::Cluster::get_system_log(undef, 0);
 exit 0;
 
 #print PVE::Cluster::get_system_log(undef, 0);



More information about the pve-devel mailing list