]> git.proxmox.com Git - pmg-api.git/commitdiff
pbs config: whitespace and wording cleanups
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 17 Nov 2020 09:30:53 +0000 (10:30 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 17 Nov 2020 09:31:06 +0000 (10:31 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/PBSConfig.pm

index 36479ceaf15e5bfffb281d4b683fde47f1bbff85..122ae992b3815dc527fca0898d323758b78a549d 100644 (file)
@@ -16,7 +16,6 @@ my $inotify_file_id = 'pmg-pbs.conf';
 my $secret_dir = '/etc/pmg/pbs';
 my $config_filename = "${secret_dir}/pbs.conf";
 
-
 my %prune_option = (
     optional => 1,
     type => 'integer', minimum => '0',
@@ -30,28 +29,28 @@ my %prune_properties = (
     },
     'keep-hourly' => {
        %prune_option,
-       description => 'Keep backups for the last <N> different hours. If there is more' .
-                      'than one backup for a single hour, only the latest one is kept.'
+       description => 'Keep backups for the last <N> different hours. If there is'
+           .' more than one backup for a single hour, only the latest one is kept.'
     },
     'keep-daily' => {
        %prune_option,
-       description => 'Keep backups for the last <N> different days. If there is more' .
-                      'than one backup for a single day, only the latest one is kept.'
+       description => 'Keep backups for the last <N> different days. If there is'
+           .' more than one backup for a single day, only the latest one is kept.'
     },
     'keep-weekly' => {
        %prune_option,
-       description => 'Keep backups for the last <N> different weeks. If there is more' .
-                      'than one backup for a single week, only the latest one is kept.'
+       description => 'Keep backups for the last <N> different weeks. If there is'
+           .'more than one backup for a single week, only the latest one is kept.'
     },
     'keep-monthly' => {
        %prune_option,
-       description => 'Keep backups for the last <N> different months. If there is more' .
-                      'than one backup for a single month, only the latest one is kept.'
+       description => 'Keep backups for the last <N> different months. If there is'
+           .' more than one backup for a single month, only the latest one is kept.'
     },
     'keep-yearly' => {
        %prune_option,
-       description => 'Keep backups for the last <N> different years. If there is more' .
-                      'than one backup for a single year, only the latest one is kept.'
+       description => 'Keep backups for the last <N> different years. If there is'
+           .' more than one backup for a single year, only the latest one is kept.'
     },
 );
 
@@ -68,26 +67,27 @@ my $defaultData = {
 sub properties {
     return {
        datastore => {
-           description => "Proxmox backup server datastore name.",
+           description => "Proxmox Backup Server datastore name.",
            type => 'string',
        },
        server => {
-           description => "Proxmox backup server address.",
+           description => "Proxmox Backup Server address.",
            type => 'string', format => 'address',
            maxLength => 256,
        },
        disable => {
-           description => "Flag to disable/deactivate the entry.",
+           description => "Flag to disable (deactivate) the entry.",
            type => 'boolean',
            optional => 1,
        },
        password => {
-           description => "Password for the user on the Proxmox backup server.",
+           description => "Password or API token secret for the user on the"
+               ." Proxmox Backup Server.",
            type => 'string',
            optional => 1,
        },
        username => get_standard_option('pmg-email-address', {
-           description => "Username on the Proxmox backup server"
+           description => "Username or API token ID on the Proxmox Backup Server"
        }),
        fingerprint => get_standard_option('fingerprint-sha256'),
        %prune_properties,
@@ -125,9 +125,7 @@ sub prune_options {
     my $remote_cfg = $self->{ids}->{$remote};
 
     my $res = {};
-
     foreach my $keep_opt (keys %prune_properties) {
-
        if (defined($remote_cfg->{$keep_opt})) {
            $res->{$keep_opt} = $remote_cfg->{$keep_opt};
        }
@@ -153,18 +151,17 @@ sub write {
     PVE::INotify::write_file($inotify_file_id, $self);
 }
 
-my $lockfile = "/var/lock/pmgpbsconfig.lck";
-
 sub lock_config {
     my ($code, $errmsg) = @_;
 
+    my $lockfile = "/var/lock/pmgpbsconfig.lck";
+
     my $p = PVE::Tools::lock_file($lockfile, undef, $code);
     if (my $err = $@) {
        $errmsg ? die "$errmsg: $err" : die $err;
     }
 }
 
-
 __PACKAGE__->register();
 __PACKAGE__->init();
 
@@ -186,10 +183,13 @@ sub write_pmg_pbs_conf {
     PVE::Tools::safe_print($filename, $fh, $raw);
 }
 
-PVE::INotify::register_file($inotify_file_id, $config_filename,
-                           \&read_pmg_pbs_conf,
-                           \&write_pmg_pbs_conf,
-                           undef,
-                           always_call_parser => 1);
+PVE::INotify::register_file(
+    $inotify_file_id,
+    $config_filename,
+    \&read_pmg_pbs_conf,
+    \&write_pmg_pbs_conf,
+    undef,
+    always_call_parser => 1
+);
 
 1;