]> git.proxmox.com Git - pve-manager.git/commitdiff
whitespace fix
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 29 Jun 2018 08:20:23 +0000 (10:20 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 29 Jun 2018 08:31:23 +0000 (10:31 +0200)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Tasks.pm

index 1395b6b95d32069cc9c9bf51e39509e73675ee58..a5acb1185024fcc58fb8507f29478cfe0b2a6a81 100644 (file)
@@ -17,12 +17,12 @@ use PVE::AccessControl;
 use base qw(PVE::RESTHandler);
 
 __PACKAGE__->register_method({
-    name => 'node_tasks', 
-    path => '', 
+    name => 'node_tasks',
+    path => '',
     method => 'GET',
-    permissions => { 
+    permissions => {
        description => "List task associated with the current user, or all task the user has 'Sys.Audit' permissions on /nodes/<node> (the <node> the task runs on).",
-       user => 'all' 
+       user => 'all'
     },
     description => "Read task list for one node (finished tasks).",
     proxyto => 'node',
@@ -111,7 +111,7 @@ __PACKAGE__->register_method({
 
                    return if $errors && $status && $status eq 'OK';
 
-                   return if $param->{vmid} && (!$task->{id} || $task->{id} ne $param->{vmid}); 
+                   return if $param->{vmid} && (!$task->{id} || $task->{id} ne $param->{vmid});
 
                    return if $count++ < $start;
                    return if $limit <= 0;
@@ -125,13 +125,13 @@ __PACKAGE__->register_method({
            }
        };
 
-       if (my $bw = File::ReadBackwards->new($filename)) {     
+       if (my $bw = File::ReadBackwards->new($filename)) {
            while (defined ($line = $bw->readline)) {
                &$parse_line();
            }
            $bw->close();
        }
-       if (my $bw = File::ReadBackwards->new("$filename.1")) { 
+       if (my $bw = File::ReadBackwards->new("$filename.1")) {
            while (defined ($line = $bw->readline)) {
                &$parse_line();
            }
@@ -144,8 +144,8 @@ __PACKAGE__->register_method({
     }});
 
 __PACKAGE__->register_method({
-    name => 'upid_index', 
-    path => '{upid}', 
+    name => 'upid_index',
+    path => '{upid}',
     method => 'GET',
     description => '', # index helper
     permissions => { user => 'all' },
@@ -174,13 +174,13 @@ __PACKAGE__->register_method({
     }});
 
 __PACKAGE__->register_method({
-    name => 'stop_task', 
-    path => '{upid}', 
+    name => 'stop_task',
+    path => '{upid}',
     method => 'DELETE',
     description => 'Stop a task.',
-    permissions => { 
+    permissions => {
        description => "The user needs 'Sys.Modify' permissions on '/nodes/<node>' if the task does not belong to him.",
-       user => 'all', 
+       user => 'all',
     },
     protected => 1,
     proxyto => 'node',
@@ -213,10 +213,10 @@ __PACKAGE__->register_method({
     }});
 
 __PACKAGE__->register_method({
-    name => 'read_task_log', 
-    path => '{upid}/log', 
+    name => 'read_task_log',
+    path => '{upid}/log',
     method => 'GET',
-    permissions => { 
+    permissions => {
        description => "The user needs 'Sys.Audit' permissions on '/nodes/<node>' if the task does not belong to him.",
        user => 'all',
     },
@@ -244,7 +244,7 @@ __PACKAGE__->register_method({
     },
     returns => {
        type => 'array',
-       items => { 
+       items => {
            type => "object",
            properties => {
                n => {
@@ -285,10 +285,10 @@ __PACKAGE__->register_method({
 my $exit_status_cache = {};
 
 __PACKAGE__->register_method({
-    name => 'read_task_status', 
-    path => '{upid}/status', 
+    name => 'read_task_status',
+    path => '{upid}/status',
     method => 'GET',
-    permissions => { 
+    permissions => {
        description => "The user needs 'Sys.Audit' permissions on '/nodes/<node>' if the task does not belong to him.",
        user => 'all',
     },
@@ -305,11 +305,11 @@ __PACKAGE__->register_method({
     returns => {
        type => "object",
        properties => {
-           pid => { 
+           pid => {
                type => 'integer'
            },
-           status => { 
-               type => 'string', enum => ['running', 'stopped'], 
+           status => {
+               type => 'string', enum => ['running', 'stopped'],
            },
        },
     },
@@ -338,7 +338,7 @@ __PACKAGE__->register_method({
 
        if ($task->{status} eq 'stopped') {
            if (!defined($exit_status_cache->{$task->{upid}})) {
-               $exit_status_cache->{$task->{upid}} = 
+               $exit_status_cache->{$task->{upid}} =
                    PVE::Tools::upid_read_status($task->{upid});
            }
            $task->{exitstatus} = $exit_status_cache->{$task->{upid}};