[pve-devel] r6440 - in pve-cluster/trunk: . data data/PVE debian

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Aug 10 07:58:34 CEST 2011


Author: dietmar
Date: 2011-08-10 07:58:34 +0200 (Wed, 10 Aug 2011)
New Revision: 6440

Removed:
   pve-cluster/trunk/data/PVE/pvecert
   pve-cluster/trunk/debian/postinst.ex
   pve-cluster/trunk/debian/postrm.ex
   pve-cluster/trunk/debian/preinst.ex
   pve-cluster/trunk/debian/prerm.ex
Modified:
   pve-cluster/trunk/Makefile
   pve-cluster/trunk/data/ChangeLog
   pve-cluster/trunk/data/PVE/Makefile.am
   pve-cluster/trunk/data/PVE/pvecm
   pve-cluster/trunk/debian/changelog
   pve-cluster/trunk/debian/init.d
   pve-cluster/trunk/debian/postinst
Log:
  * removed pvecert binray (use pvecm instead)
  * removed debian template scripts


Modified: pve-cluster/trunk/Makefile
===================================================================
--- pve-cluster/trunk/Makefile	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/Makefile	2011-08-10 05:58:34 UTC (rev 6440)
@@ -2,7 +2,7 @@
 
 PACKAGE=pve-cluster
 PKGVER=1.0
-PKGREL=5
+PKGREL=6
 
 ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
 

Modified: pve-cluster/trunk/data/ChangeLog
===================================================================
--- pve-cluster/trunk/data/ChangeLog	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/data/ChangeLog	2011-08-10 05:58:34 UTC (rev 6440)
@@ -1,5 +1,10 @@
 2011-08-10  Proxmox Support Team  <support at proxmox.com>
 
+	* PVE/pvecert: removed binray (use pvecm instead)
+
+	* PVE/pvecm (lsnode): remove verifyapi handling code.
+	(updatecerts): new method (replacement for pvecert binary) 
+
 	* PVE/pvecert: also update ssh related files.
 
 	* PVE/Cluster.pm (ssh_merge_known_hosts): replace entries with

Modified: pve-cluster/trunk/data/PVE/Makefile.am
===================================================================
--- pve-cluster/trunk/data/PVE/Makefile.am	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/data/PVE/Makefile.am	2011-08-10 05:58:34 UTC (rev 6440)
@@ -1,5 +1,5 @@
 
-bin_SCRIPTS = pvecm pvecert
+bin_SCRIPTS = pvecm
 
 IPCC.c: IPCC.xs
 	xsubpp IPCC.xs > IPCC.xsc

Deleted: pve-cluster/trunk/data/PVE/pvecert
===================================================================
--- pve-cluster/trunk/data/PVE/pvecert	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/data/PVE/pvecert	2011-08-10 05:58:34 UTC (rev 6440)
@@ -1,26 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use PVE::Cluster;
-use Getopt::Long;
-use PVE::INotify;
-
-$ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
-
-die "please run as root\n" if $> != 0;
-
-my $opt_force;
-my $opt_silent; # supress error if we do not have quorum
-
-if (!GetOptions ('force' => \$opt_force, 'silent' => \$opt_silent)) {
-    print STDERR "Usage: pvecert [--force] [--silent]\n";
-    exit (-1);
-}
-
-exit (0) if $opt_silent && !PVE::Cluster::check_cfs_quorum();
-
-my $nodename = PVE::INotify::nodename();
-my $ip = PVE::Cluster::remote_node_ip($nodename);
-PVE::Cluster::gen_pve_node_files($nodename, $ip, $opt_force);
-PVE::Cluster::ssh_merge_known_hosts($nodename, $ip);
-exit (0);

Modified: pve-cluster/trunk/data/PVE/pvecm
===================================================================
--- pve-cluster/trunk/data/PVE/pvecm	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/data/PVE/pvecm	2011-08-10 05:58:34 UTC (rev 6440)
@@ -168,6 +168,8 @@
 
 	-f $clusterconf && die "cluster config '$clusterconf' already exists\n";
 
+	PVE::Cluster::setup_ssh_keys();
+
 	-f $authfile || __PACKAGE__->keygen({filename => $authfile});
 
 	-f $authfile || die "no authentication key available\n";
@@ -203,7 +205,7 @@
 
 	PVE::Cluster::gen_pve_node_files($nodename, $local_ip_address);
 
-	PVE::Cluster::ssh_merge_known_hosts($nodename, $local_ip_address);
+	PVE::Cluster::ssh_merge_known_hosts($nodename, $local_ip_address, 1);
 
 	PVE::Tools::run_command('/etc/init.d/pve-cluster restart'); # restart
 
@@ -367,6 +369,8 @@
     code => sub {
 	my ($param) = @_;
 
+	PVE::Cluster::setup_ssh_keys();
+
 	my $host = $param->{hostname};
 
 	if (!$param->{force}) {
@@ -459,7 +463,7 @@
 	    PVE::Cluster::gen_pve_node_files($nodename, $local_ip_address); 
 
 	    print "merge known_hosts file\n";
-	    PVE::Cluster::ssh_merge_known_hosts($nodename, $local_ip_address);
+	    PVE::Cluster::ssh_merge_known_hosts($nodename, $local_ip_address, 1);
 
 	    print "restart services\n";
 	    # restart apache (changed certs)
@@ -573,6 +577,43 @@
     return $res;
 }
 
+__PACKAGE__->register_method ({
+    name => 'updatecerts', 
+    path => 'updatecerts',
+    method => 'PUT',
+    description => "Update node certificates.",
+    parameters => {
+    	additionalProperties => 0,
+	properties => {
+	    force => {
+		description => "Force generation of new SSL certifate.",
+		type => 'boolean',
+		optional => 1,
+	    },
+	    silent => {
+		description => "Ignore errors (i.e. when cluster has no quorum).",
+		type => 'boolean',
+		optional => 1,
+	    },
+	},
+    },
+    returns => { type => 'null' },
+    code => sub {
+	my ($param) = @_;
+
+	if (!PVE::Cluster::check_cfs_quorum()) {
+	    return undef if $param->{silent};
+	    die "no quorum - unable to update files\n";
+	}
+
+	PVE::Cluster::gen_pve_node_files($nodename, $local_ip_address, $param->{force});
+	PVE::Cluster::ssh_merge_keys();
+	PVE::Cluster::ssh_merge_known_hosts($nodename, $local_ip_address);
+
+	return undef;
+    }});
+
+
 my $cmddef = {
     keygen => [ __PACKAGE__, 'keygen', ['filename']],
     create => [ __PACKAGE__, 'create', ['clustername']],
@@ -582,19 +623,13 @@
     status => [ __PACKAGE__, 'status' ],
     nodes => [ __PACKAGE__, 'nodes' ],
     expected => [ __PACKAGE__, 'expected', ['expected']],
+    updatecerts => [ __PACKAGE__, 'updatecerts', []],
 };
 
 my $cmd = shift;
-
-if ($cmd && $cmd eq 'verifyapi') {
-    PVE::RESTHandler::validate_method_schemas();
-    exit 0;
-}
  
 PVE::Cluster::check_cfs_is_mounted();
 
-PVE::Cluster::setup_ssh_keys();
-
 PVE::Cluster::cfs_update();
 
 PVE::CLIHandler::handle_cmd($cmddef, "pvecm", $cmd, \@ARGV);

Modified: pve-cluster/trunk/debian/changelog
===================================================================
--- pve-cluster/trunk/debian/changelog	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/debian/changelog	2011-08-10 05:58:34 UTC (rev 6440)
@@ -1,3 +1,9 @@
+pve-cluster (1.0-6) unstable; urgency=low
+
+  * removed pvecert binray (use pvecm instead)
+
+ -- Proxmox Support Team <support at proxmox.com>  Wed, 10 Aug 2011 07:55:41 +0200
+
 pve-cluster (1.0-5) unstable; urgency=low
 
   * fix known_hosts handling (use /etc/ssh/ssh_known_hosts)

Modified: pve-cluster/trunk/debian/init.d
===================================================================
--- pve-cluster/trunk/debian/init.d	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/debian/init.d	2011-08-10 05:58:34 UTC (rev 6440)
@@ -86,7 +86,7 @@
 	# in a cluster setup. But this doesn't matter, because the 
 	# cluster manager creates all needed files (pvecm)
 	if [ $errcode -eq 0 ] ; then
-	    /usr/bin/pvecert --silent || true
+	    /usr/bin/pvecm updatecerts --silent || true
 	fi
         log_end_msg $errcode
 	;;

Modified: pve-cluster/trunk/debian/postinst
===================================================================
--- pve-cluster/trunk/debian/postinst	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/debian/postinst	2011-08-10 05:58:34 UTC (rev 6440)
@@ -27,7 +27,7 @@
 	if test ! -e /proxmox_install_mode; then
 	    invoke-rc.d pve-cluster restart
 	    invoke-rc.d rsyslog restart
-	    pvecert --silent 
+	    pvecm updatecerts --silent 
 	fi
     ;;
 

Deleted: pve-cluster/trunk/debian/postinst.ex
===================================================================
--- pve-cluster/trunk/debian/postinst.ex	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/debian/postinst.ex	2011-08-10 05:58:34 UTC (rev 6440)
@@ -1,41 +0,0 @@
-#!/bin/sh
-# postinst script for pve-cluster
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-#        * <postinst> `configure' <most-recently-configured-version>
-#        * <old-postinst> `abort-upgrade' <new version>
-#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-#          <new-version>
-#        * <postinst> `abort-remove'
-#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-#          <failed-install-package> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    configure)
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-

Deleted: pve-cluster/trunk/debian/postrm.ex
===================================================================
--- pve-cluster/trunk/debian/postrm.ex	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/debian/postrm.ex	2011-08-10 05:58:34 UTC (rev 6440)
@@ -1,39 +0,0 @@
-#!/bin/sh
-# postrm script for pve-cluster
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-#        * <postrm> `remove'
-#        * <postrm> `purge'
-#        * <old-postrm> `upgrade' <new-version>
-#        * <new-postrm> `failed-upgrade' <old-version>
-#        * <new-postrm> `abort-install'
-#        * <new-postrm> `abort-install' <old-version>
-#        * <new-postrm> `abort-upgrade' <old-version>
-#        * <disappearer's-postrm> `disappear' <overwriter>
-#          <overwriter-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-    ;;
-
-    *)
-        echo "postrm called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-

Deleted: pve-cluster/trunk/debian/preinst.ex
===================================================================
--- pve-cluster/trunk/debian/preinst.ex	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/debian/preinst.ex	2011-08-10 05:58:34 UTC (rev 6440)
@@ -1,37 +0,0 @@
-#!/bin/sh
-# preinst script for pve-cluster
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-#        * <new-preinst> `install'
-#        * <new-preinst> `install' <old-version>
-#        * <new-preinst> `upgrade' <old-version>
-#        * <old-preinst> `abort-upgrade' <new-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    install|upgrade)
-    ;;
-
-    abort-upgrade)
-    ;;
-
-    *)
-        echo "preinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-

Deleted: pve-cluster/trunk/debian/prerm.ex
===================================================================
--- pve-cluster/trunk/debian/prerm.ex	2011-08-10 05:22:26 UTC (rev 6439)
+++ pve-cluster/trunk/debian/prerm.ex	2011-08-10 05:58:34 UTC (rev 6440)
@@ -1,40 +0,0 @@
-#!/bin/sh
-# prerm script for pve-cluster
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-#        * <prerm> `remove'
-#        * <old-prerm> `upgrade' <new-version>
-#        * <new-prerm> `failed-upgrade' <old-version>
-#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
-#        * <deconfigured's-prerm> `deconfigure' `in-favour'
-#          <package-being-installed> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    remove|upgrade|deconfigure)
-    ;;
-
-    failed-upgrade)
-    ;;
-
-    *)
-        echo "prerm called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-



More information about the pve-devel mailing list