[pve-devel] [v2 manager 15/27] ceph/createpool: shorten pool variable name

Fabian Gr├╝nbichler f.gruenbichler at proxmox.com
Tue Aug 29 13:04:37 CEST 2017


Signed-off-by: Fabian Gr├╝nbichler <f.gruenbichler at proxmox.com>
---
rebased v1

 PVE/API2/Ceph.pm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 2492fff8..7514d933 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -1769,6 +1769,8 @@ __PACKAGE__->register_method ({
 	die "not fully configured - missing '$pve_ckeyring_path'\n"
 	    if ! -f $pve_ckeyring_path;
 
+	my $pool = $param->{name};
+
 	my $pg_num = $param->{pg_num} || 64;
 	my $size = $param->{size} || 3;
 	my $min_size = $param->{min_size} || 2;
@@ -1777,14 +1779,14 @@ __PACKAGE__->register_method ({
 
 	$rados->mon_command({
 	    prefix => "osd pool create",
-	    pool => $param->{name},
+	    pool => $pool,
 	    pg_num => int($pg_num),
 	    format => 'plain',
 	});
 
 	$rados->mon_command({
 	    prefix => "osd pool set",
-	    pool => $param->{name},
+	    pool => $pool,
 	    var => 'min_size',
 	    val => $min_size,
 	    format => 'plain',
@@ -1792,7 +1794,7 @@ __PACKAGE__->register_method ({
 
 	$rados->mon_command({
 	    prefix => "osd pool set",
-	    pool => $param->{name},
+	    pool => $pool,
 	    var => 'size',
 	    val => $size,
 	    format => 'plain',
@@ -1801,7 +1803,7 @@ __PACKAGE__->register_method ({
 	if (defined($param->{crush_rule})) {
 	    $rados->mon_command({
 		prefix => "osd pool set",
-		pool => $param->{name},
+		pool => $pool,
 		var => 'crush_rule',
 		val => $param->{crush_rule},
 		format => 'plain',
@@ -1810,7 +1812,7 @@ __PACKAGE__->register_method ({
 
 	$rados->mon_command({
 		prefix => "osd pool application enable",
-		pool => $param->{name},
+		pool => $pool,
 		app => $application,
 	});
 
-- 
2.11.0




More information about the pve-devel mailing list