[pve-devel] [PATCH manager 16/20] ceph/createpool: shorten pool variable name

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Aug 25 10:48:18 CEST 2017


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 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 7690d7a1..918f9dd6 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -1780,6 +1780,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;
@@ -1788,14 +1790,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',
@@ -1803,7 +1805,7 @@ __PACKAGE__->register_method ({
 
 	$rados->mon_command({
 	    prefix => "osd pool set",
-	    pool => $param->{name},
+	    pool => $pool,
 	    var => 'size',
 	    val => $size,
 	    format => 'plain',
@@ -1812,7 +1814,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',
@@ -1821,7 +1823,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