[pve-devel] r5365 - in pve-manager/pve2: . bin debian lib/PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Jan 12 13:38:33 CET 2011


Author: dietmar
Date: 2011-01-12 13:38:33 +0100 (Wed, 12 Jan 2011)
New Revision: 5365

Removed:
   pve-manager/pve2/bin/pvecert
Modified:
   pve-manager/pve2/ChangeLog
   pve-manager/pve2/bin/Makefile.am
   pve-manager/pve2/bin/Makefile.in
   pve-manager/pve2/bin/pvectl
   pve-manager/pve2/debian/postinst
   pve-manager/pve2/lib/PVE/Cluster.pm
   pve-manager/pve2/lib/PVE/Makefile.am
   pve-manager/pve2/lib/PVE/Utils.pm
Log:
2011-01-12  root  <root at maui.maurer-it.com>

	* lib/PVE/Makefile.am: do not install outdated files

	* bin/pvectl (read_glogal_vz_config): remove PVE::Cluster calls

	* bin/pvecert: moved to package 'pve-cluster'
	
	* debian/postinst: do not call pvecert



Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog	2011-01-12 11:43:16 UTC (rev 5364)
+++ pve-manager/pve2/ChangeLog	2011-01-12 12:38:33 UTC (rev 5365)
@@ -1,3 +1,13 @@
+2011-01-12  root  <root at maui.maurer-it.com>
+
+	* lib/PVE/Makefile.am: do not install outdated files
+
+	* bin/pvectl (read_glogal_vz_config): remove PVE::Cluster calls
+
+	* bin/pvecert: moved to package 'pve-cluster'
+	
+	* debian/postinst: do not call pvecert
+
 2011-01-11  root  <root at maui.maurer-it.com>
 
 	* bin/init.d/pvedaemon: depend on pve-cluster

Modified: pve-manager/pve2/bin/Makefile.am
===================================================================
--- pve-manager/pve2/bin/Makefile.am	2011-01-12 11:43:16 UTC (rev 5364)
+++ pve-manager/pve2/bin/Makefile.am	2011-01-12 12:38:33 UTC (rev 5365)
@@ -5,7 +5,6 @@
 bin_SCRIPTS =  			\
 	pvesh			\
 	pveam			\
-	pvecert			\
 	pvebanner		\
 	pvectl			\
 	pvebash			\

Modified: pve-manager/pve2/bin/Makefile.in
===================================================================
--- pve-manager/pve2/bin/Makefile.in	2011-01-12 11:43:16 UTC (rev 5364)
+++ pve-manager/pve2/bin/Makefile.in	2011-01-12 12:38:33 UTC (rev 5365)
@@ -218,7 +218,6 @@
 bin_SCRIPTS = \
 	pvesh			\
 	pveam			\
-	pvecert			\
 	pvebanner		\
 	pvectl			\
 	pvebash			\

Deleted: pve-manager/pve2/bin/pvecert
===================================================================
--- pve-manager/pve2/bin/pvecert	2011-01-12 11:43:16 UTC (rev 5364)
+++ pve-manager/pve2/bin/pvecert	2011-01-12 12:38:33 UTC (rev 5365)
@@ -1,45 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use PVE::Cluster;
-use Getopt::Long;
-use PVE::RPCEnvironment;
-use PVE::INotify qw(read_file);
-use PVE::AccessControl;
-
-$ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
-
-die "please run as root\n" if $> != 0;
-
-PVE::INotify::inotify_init();
-
-my $rpcenv = PVE::RPCEnvironment->init('cli');
-
-$rpcenv->set_language($ENV{LANG});
-
-$rpcenv->set_user('root'); 
-
-my $hostname = $rpcenv->get_hostname();
-
-my $opt_force;
-
-if (!GetOptions ('force' => \$opt_force)) {
-    print STDERR "Usage: pvecert [--force]\n";
-    exit (-1);
-}
-
-PVE::Cluster::gen_local_dirs($hostname);
-
-# make sure we have a (per node) private key
-PVE::Cluster::gen_pve_ssl_key();
-
-# make sure we have a CA
-my $force = PVE::Cluster::gen_pveca_cert();
-
-$force = 1 if $opt_force;
-
-PVE::Cluster::gen_pve_ssl_cert ($force, $hostname);
-
-PVE::AccessControl::cond_create_auth_key();
-
-exit (0);

Modified: pve-manager/pve2/bin/pvectl
===================================================================
--- pve-manager/pve2/bin/pvectl	2011-01-12 11:43:16 UTC (rev 5364)
+++ pve-manager/pve2/bin/pvectl	2011-01-12 12:38:33 UTC (rev 5365)
@@ -3,7 +3,6 @@
 use strict;
 use Getopt::Long;
 use PVE::Config;
-use PVE::Cluster;
 use PVE::Utils;
 use PVE::Storage;
 use POSIX qw (LONG_MAX);
@@ -294,8 +293,6 @@
 my $opt_rootpasswd;
 my $opt_description;
 
-my $cinfo = PVE::Cluster::clusterinfo();
-
 my $stcfg = PVE::Storage::load_config();
 
 if ($cmd eq 'vzcreate' || $cmd eq 'vzset') {
@@ -321,7 +318,7 @@
 	exit (-1);
     }
 
-    PVE::Cluster::check_vm_settings ({
+    PVE::Utils::check_vm_settings ({
 	mem => $opt_mem,
 	swap => $opt_swap,
 	disk => $opt_disk,
@@ -355,14 +352,6 @@
 	    exit (-1);
 	}
 
-	PVE::Cluster::sync_templates ($cinfo);
-
-	# test again
-	if (-f "$confdir/${vmid}.conf") {
-	    print STDERR "VE $vmid already exists\n";
-	    exit (-1);
-	}
-
 	my $cmd = ['vzctl', 'create', $vmid, '--ostemplate', $tpath,
 		   '--config', 'pve.auto'];
 	eval {

Modified: pve-manager/pve2/debian/postinst
===================================================================
--- pve-manager/pve2/debian/postinst	2011-01-12 11:43:16 UTC (rev 5364)
+++ pve-manager/pve2/debian/postinst	2011-01-12 12:38:33 UTC (rev 5365)
@@ -29,9 +29,6 @@
     update-rc.d pvebanner defaults 99 >/dev/null 2>&1
     update-rc.d pvenetcommit start 15 S . >/dev/null 2>&1
 
-    # generate ssl keys
-     test -e /proxmox_install_mode || pvecert
-
     # make sure we have a crontab for vzdump
     touch /etc/cron.d/vzdump
 

Modified: pve-manager/pve2/lib/PVE/Cluster.pm
===================================================================
--- pve-manager/pve2/lib/PVE/Cluster.pm	2011-01-12 11:43:16 UTC (rev 5364)
+++ pve-manager/pve2/lib/PVE/Cluster.pm	2011-01-12 12:38:33 UTC (rev 5365)
@@ -582,42 +582,6 @@
     return $vminfo;
 }
 
-sub check_vm_settings {
-    my ($settings) = @_;
-
-    if (defined ($settings->{mem})) {
-
-	my $max = 65536;
-	my $min = 64;
-
-	if ($settings->{mem} < $min) {
-	    die __("Memory needs to be at least $min MB") . "\n";
-	}
-	if ($settings->{mem} > $max) {
-	    die __("Memory needs to be less than $max MB") . "\n";
-	}
-    }
-
-    if (defined ($settings->{swap})) {
-
-	my $max = 65536;
-	
-	if ($settings->{swap} > $max) {
-	    die __("Swap needs to be less than $max MB") . "\n";
-	}
-    }
-
-    if (defined ($settings->{cpuunits}) && 
-	($settings->{cpuunits} < 8 || $settings->{cpuunits} > 500000)) {
-	die "parameter cpuunits out of range\n";
-    }
-
-    if (defined ($settings->{cpus}) && 
-	($settings->{cpus} < 1 || $settings->{cpus} > 16)) {
-	die "parameter cpus out of range\n";
-    }
-} 
-
 sub sync_templates {
     my ($cinfo) = @_;
 

Modified: pve-manager/pve2/lib/PVE/Makefile.am
===================================================================
--- pve-manager/pve2/lib/PVE/Makefile.am	2011-01-12 11:43:16 UTC (rev 5364)
+++ pve-manager/pve2/lib/PVE/Makefile.am	2011-01-12 12:38:33 UTC (rev 5365)
@@ -7,22 +7,9 @@
 	API2Client.pm		\
 	APIDaemon.pm		\
 	REST.pm			\
-	SourceFilter.pm		\
-	URLRewrite.pm		\
-	I18N.pm			\
-	HTMLUtils.pm		\
-	HTMLTable.pm		\
-	HTMLForm.pm		\
-	HTMLGrid.pm		\
-	HTMLDropDown.pm		\
-	HTMLControls.pm		\
-	HTMLServices.pm		\
 	Utils.pm		\
 	OpenVZ.pm		\
 	Qemu.pm			\
-	Cluster.pm		\
-	Config.pm		\
-	ConfigServer.pm		\
 	APLInfo.pm
 
 

Modified: pve-manager/pve2/lib/PVE/Utils.pm
===================================================================
--- pve-manager/pve2/lib/PVE/Utils.pm	2011-01-12 11:43:16 UTC (rev 5364)
+++ pve-manager/pve2/lib/PVE/Utils.pm	2011-01-12 12:38:33 UTC (rev 5365)
@@ -984,5 +984,41 @@
     }
 }
 
+sub check_vm_settings {
+    my ($settings) = @_;
+
+    if (defined ($settings->{mem})) {
+
+	my $max = 65536;
+	my $min = 64;
+
+	if ($settings->{mem} < $min) {
+	    die __("Memory needs to be at least $min MB") . "\n";
+	}
+	if ($settings->{mem} > $max) {
+	    die __("Memory needs to be less than $max MB") . "\n";
+	}
+    }
+
+    if (defined ($settings->{swap})) {
+
+	my $max = 65536;
+	
+	if ($settings->{swap} > $max) {
+	    die __("Swap needs to be less than $max MB") . "\n";
+	}
+    }
+
+    if (defined ($settings->{cpuunits}) && 
+	($settings->{cpuunits} < 8 || $settings->{cpuunits} > 500000)) {
+	die "parameter cpuunits out of range\n";
+    }
+
+    if (defined ($settings->{cpus}) && 
+	($settings->{cpus} < 1 || $settings->{cpus} > 16)) {
+	die "parameter cpus out of range\n";
+    }
+} 
+
 1;
 




More information about the pve-devel mailing list