[pve-devel] [PATCH manager 3/3] whitespace cleanup

Dominik Csapak d.csapak at proxmox.com
Tue Jul 25 17:14:42 CEST 2017


and intendation fix

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Ceph.pm | 120 +++++++++++++++++++++++++++----------------------------
 1 file changed, 60 insertions(+), 60 deletions(-)

diff --git a/PVE/API2/Ceph.pm b/PVE/API2/Ceph.pm
index 85413487..b160a35c 100644
--- a/PVE/API2/Ceph.pm
+++ b/PVE/API2/Ceph.pm
@@ -34,7 +34,7 @@ my $get_osd_status = sub {
 
     my $osdstat;
     foreach my $d (@$osdlist) {
-	$osdstat->{$d->{osd}} = $d if defined($d->{osd});    
+	$osdstat->{$d->{osd}} = $d if defined($d->{osd});
     }
     if (defined($osdid)) {
 	die "no such OSD '$osdid'\n" if !$osdstat->{$osdid};
@@ -47,12 +47,12 @@ my $get_osd_status = sub {
 my $get_osd_usage = sub {
     my ($rados) = @_;
 
-    my $osdlist = $rados->mon_command({ prefix => 'pg dump', 
+    my $osdlist = $rados->mon_command({ prefix => 'pg dump',
 					dumpcontents => [ 'osds' ]}) || [];
 
     my $osdstat;
     foreach my $d (@$osdlist) {
-	$osdstat->{$d->{osd}} = $d if defined($d->{osd});    
+	$osdstat->{$d->{osd}} = $d if defined($d->{osd});
     }
 
     return $osdstat;
@@ -69,7 +69,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any => 1],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	},
@@ -96,10 +96,10 @@ __PACKAGE__->register_method ({
 	my $newnodes = {};
 	foreach my $e (@{$res->{nodes}}) {
 	    $nodes->{$e->{id}} = $e;
-	    
-	    my $new = { 
-		id => $e->{id}, 
-		name => $e->{name}, 
+
+	    my $new = {
+		id => $e->{id},
+		name => $e->{name},
 		type => $e->{type}
 	    };
 
@@ -167,7 +167,7 @@ __PACKAGE__->register_method ({
     proxyto => 'node',
     protected => 1,
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    dev => {
@@ -226,7 +226,7 @@ __PACKAGE__->register_method ({
 	die "unable to get device info for '$devname'\n"
 	    if !$diskinfo;
 
-	die "device '$param->{dev}' is in use\n" 
+	die "device '$param->{dev}' is in use\n"
 	    if $diskinfo->{used};
 
 	my $devpath = $diskinfo->{devpath};
@@ -243,7 +243,7 @@ __PACKAGE__->register_method ({
 	    my $bindata = $rados->mon_command({ prefix => 'auth get', entity => 'client.bootstrap-osd', format => 'plain' });
 	    PVE::Tools::file_set_contents($ceph_bootstrap_osd_keyring, $bindata);
 	};
-        
+
 	my $worker = sub {
 	    my $upid = shift;
 
@@ -269,7 +269,7 @@ __PACKAGE__->register_method ({
 	    } else {
 		push @$cmd, $devpath;
 	    }
-	    
+
 	    run_command($cmd);
 	};
 
@@ -284,7 +284,7 @@ __PACKAGE__->register_method ({
     proxyto => 'node',
     protected => 1,
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    osdid => {
@@ -325,7 +325,7 @@ __PACKAGE__->register_method ({
 	    my $upid = shift;
 
 	    # reopen with longer timeout
-	    $rados = PVE::RADOS->new(timeout => PVE::CephTools::get_config('long_rados_timeout')); 
+	    $rados = PVE::RADOS->new(timeout => PVE::CephTools::get_config('long_rados_timeout'));
 
 	    print "destroy OSD $osdsection\n";
 
@@ -358,7 +358,7 @@ __PACKAGE__->register_method ({
 
 	    my $journal_part;
 	    my $data_part;
-	    
+
 	    if ($param->{cleanup}) {
 		my $jpath = "$mountpoint/journal";
 		$journal_part = abs_path($jpath);
@@ -402,7 +402,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Modify' ]],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    osdid => {
@@ -441,7 +441,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Modify' ]],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    osdid => {
@@ -502,7 +502,7 @@ use Data::Dumper; # fixme: remove
 my $pve_osd_default_journal_size = 1024*5;
 
 __PACKAGE__->register_method ({
-    subclass => "PVE::API2::CephOSD",  
+    subclass => "PVE::API2::CephOSD",
     path => 'osd',
 });
 
@@ -516,7 +516,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any => 1],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	},
@@ -561,7 +561,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any => 1],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    type => {
@@ -611,7 +611,7 @@ __PACKAGE__->register_method ({
 	    }
 
 	    $d->{dev} = "/dev/$dev";
-	    push @$res, $d; 
+	    push @$res, $d;
 	}
 
 	return $res;
@@ -626,7 +626,7 @@ __PACKAGE__->register_method ({
     },
     description => "Get Ceph configuration.",
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	},
@@ -653,7 +653,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any => 1],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	},
@@ -699,7 +699,7 @@ __PACKAGE__->register_method ({
 	    my $mons = $monstat->{monmap}->{mons};
 	    foreach my $d (@$mons) {
 		next if !defined($d->{name});
-		$monhash->{$d->{name}}->{rank} = $d->{rank}; 
+		$monhash->{$d->{name}}->{rank} = $d->{rank};
 		$monhash->{$d->{name}}->{addr} = $d->{addr};
 		if (grep { $_ eq $d->{rank} } @{$monstat->{quorum}}) {
 		    $monhash->{$d->{name}}->{quorum} = 1;
@@ -722,11 +722,11 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Modify' ]],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    network => {
-		description => "Use specific network for all ceph related traffic", 
+		description => "Use specific network for all ceph related traffic",
 		type => 'string', format => 'CIDR',
 		optional => 1,
 		maxLength => 128,
@@ -798,11 +798,11 @@ __PACKAGE__->register_method ({
 		'mon allow pool delete' => 'true',
 	    };
 
-	    # this does not work for default pools 
+	    # this does not work for default pools
 	    #'osd pool default pg num' => $pg_num,
-	    #'osd pool default pgp num' => $pg_num, 
+	    #'osd pool default pgp num' => $pg_num,
 	}
-	
+
 	$cfg->{global}->{keyring} = '/etc/pve/priv/$cluster.$name.keyring';
 	$cfg->{osd}->{keyring} = '/var/lib/ceph/osd/ceph-$id/keyring';
 
@@ -896,7 +896,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Modify' ]],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    id => {
@@ -929,7 +929,7 @@ __PACKAGE__->register_method ({
 
 	my $moncount = 0;
 
-	my $monaddrhash = {}; 
+	my $monaddrhash = {};
 
 	my $systemd_managed = PVE::CephTools::systemd_managed();
 
@@ -954,7 +954,7 @@ __PACKAGE__->register_method ({
 
 	die "unable to find usable monitor id\n" if !defined($monid);
 
-	my $monsection = "mon.$monid"; 
+	my $monsection = "mon.$monid";
 	my $ip;
 	if (my $pubnet = $cfg->{global}->{'public network'}) {
 	    $ip = &$find_node_ip($pubnet);
@@ -966,7 +966,7 @@ __PACKAGE__->register_method ({
 	my $monname = $param->{node};
 
 	die "monitor '$monsection' already exists\n" if $cfg->{$monsection};
-	die "monitor address '$monaddr' already in use by '$monaddrhash->{$monaddr}'\n" 
+	die "monitor address '$monaddr' already in use by '$monaddrhash->{$monaddr}'\n"
 	    if $monaddrhash->{$monaddr};
 
 	my $worker = sub  {
@@ -997,7 +997,7 @@ __PACKAGE__->register_method ({
 
 	    my $mondir =  "/var/lib/ceph/mon/$ccname-$monid";
 	    -d $mondir && die "monitor filesystem '$mondir' already exist\n";
- 
+
 	    my $monmap = "/tmp/monmap";
 
 	    my $rados = PVE::RADOS->new(timeout => PVE::CephTools::get_config('long_rados_timeout'));
@@ -1067,7 +1067,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Modify' ]],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    monid => {
@@ -1094,15 +1094,15 @@ __PACKAGE__->register_method ({
 	PVE::CephTools::check_ceph_inited();
 
 	my $cfg = PVE::CephTools::parse_ceph_config();
-       
+
 	my $monid = $param->{monid};
-	my $monsection = "mon.$monid";	
+	my $monsection = "mon.$monid";
 
 	my $rados = PVE::RADOS->new();
 	my $monstat = $rados->mon_command({ prefix => 'mon_status' });
 	my $monlist = $monstat->{monmap}->{mons};
 
-	die "no such monitor id '$monid'\n" 
+	die "no such monitor id '$monid'\n"
 	    if !defined($cfg->{$monsection});
 
 	my $ccname = PVE::CephTools::get_config('ccname');
@@ -1116,7 +1116,7 @@ __PACKAGE__->register_method ({
 	    my $upid = shift;
 
 	    # reopen with longer timeout
-	    $rados = PVE::RADOS->new(timeout => PVE::CephTools::get_config('long_rados_timeout')); 
+	    $rados = PVE::RADOS->new(timeout => PVE::CephTools::get_config('long_rados_timeout'));
 
 	    $rados->mon_command({ prefix => "mon remove", name => $monid, format => 'plain' });
 
@@ -1247,7 +1247,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Modify' ]],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    service => {
@@ -1297,7 +1297,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Modify' ]],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    service => {
@@ -1347,7 +1347,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any => 1],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	},
@@ -1375,7 +1375,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any => 1],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	},
@@ -1440,7 +1440,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Modify' ]],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    name => {
@@ -1489,7 +1489,7 @@ __PACKAGE__->register_method ({
 
 	my $pve_ckeyring_path = PVE::CephTools::get_config('pve_ckeyring_path');
 
-	die "not fully configured - missing '$pve_ckeyring_path'\n" 
+	die "not fully configured - missing '$pve_ckeyring_path'\n"
 	    if ! -f $pve_ckeyring_path;
 
 	my $pg_num = $param->{pg_num} || 64;
@@ -1498,7 +1498,7 @@ __PACKAGE__->register_method ({
 	my $ruleset = $param->{crush_ruleset} || 0;
 	my $rados = PVE::RADOS->new();
 
-	$rados->mon_command({ 
+	$rados->mon_command({
 	    prefix => "osd pool create",
 	    pool => $param->{name},
 	    pg_num => int($pg_num),
@@ -1507,7 +1507,7 @@ __PACKAGE__->register_method ({
 	    format => 'plain',
 	});
 
-	$rados->mon_command({ 
+	$rados->mon_command({
 	    prefix => "osd pool set",
 	    pool => $param->{name},
 	    var => 'min_size',
@@ -1515,7 +1515,7 @@ __PACKAGE__->register_method ({
 	    format => 'plain',
 	});
 
-	$rados->mon_command({ 
+	$rados->mon_command({
 	    prefix => "osd pool set",
 	    pool => $param->{name},
 	    var => 'size',
@@ -1524,7 +1524,7 @@ __PACKAGE__->register_method ({
 	});
 
 	if (defined($param->{crush_ruleset})) {
-	    $rados->mon_command({ 
+	    $rados->mon_command({
 		prefix => "osd pool set",
 		pool => $param->{name},
 		var => 'crush_ruleset',
@@ -1667,7 +1667,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Modify' ]],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    name => {
@@ -1706,7 +1706,7 @@ __PACKAGE__->register_method ({
 
 	my $rados = PVE::RADOS->new();
 	# fixme: '--yes-i-really-really-mean-it'
-	$rados->mon_command({ 
+	$rados->mon_command({
 	    prefix => "osd pool delete",
 	    pool => $param->{name},
 	    pool2 => $param->{name},
@@ -1729,7 +1729,7 @@ __PACKAGE__->register_method ({
 	check => ['perm', '/', [ 'Sys.Audit', 'Datastore.Audit' ], any => 1],
     },
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	},
@@ -1749,7 +1749,7 @@ __PACKAGE__->register_method ({
 	my $mapdata = "/var/tmp/ceph-crush.txt.$$";
 
 	my $rados = PVE::RADOS->new();
-	
+
 	eval {
 	    my $bindata = $rados->mon_command({ prefix => 'osd getcrushmap', format => 'plain' });
 	    PVE::Tools::file_set_contents($mapfile, $bindata);
@@ -1762,13 +1762,13 @@ __PACKAGE__->register_method ({
 	unlink $mapdata;
 
 	die $err if $err;
-       
+
 	return $txt;
     }});
 
 __PACKAGE__->register_method({
-    name => 'log', 
-    path => 'log', 
+    name => 'log',
+    path => 'log',
     method => 'GET',
     description => "Read ceph log",
     proxyto => 'node',
@@ -1777,7 +1777,7 @@ __PACKAGE__->register_method({
     },
     protected => 1,
     parameters => {
-    	additionalProperties => 0,
+	additionalProperties => 0,
 	properties => {
 	    node => get_standard_option('pve-node'),
 	    start => {
@@ -1794,7 +1794,7 @@ __PACKAGE__->register_method({
     },
     returns => {
 	type => 'array',
-	items => { 
+	items => {
 	    type => "object",
 	    properties => {
 		n => {
@@ -1819,8 +1819,8 @@ __PACKAGE__->register_method({
 	my ($count, $lines) = PVE::Tools::dump_logfile($logfile, $param->{start}, $param->{limit});
 
 	$rpcenv->set_result_attrib('total', $count);
-	    
-	return $lines; 
+
+	return $lines;
     }});
 
 
-- 
2.11.0





More information about the pve-devel mailing list