]> git.proxmox.com Git - pmg-api.git/commitdiff
DB Tools: code/whitespace cleanup open_ruledb
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 Nov 2022 16:05:07 +0000 (17:05 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 Nov 2022 16:05:07 +0000 (17:05 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/DBTools.pm

index bd35d2c85779677d8991a607f68e99c2701316af..cd3f7e0a680288c6ebe91e6ffc2b4b708da345b1 100644 (file)
@@ -63,8 +63,7 @@ sub open_ruledb {
 
        eval {
            alarm($timeout);
-           $rdb = DBI->connect($dsn, 'root', undef,
-                               { PrintError => 0, RaiseError => 1 });
+           $rdb = DBI->connect($dsn, 'root', undef, { PrintError => 0, RaiseError => 1 });
            alarm(0);
        };
        alarm(0);
@@ -75,9 +74,8 @@ sub open_ruledb {
        return $rdb;
     } else {
        my $dsn = "DBI:Pg:dbname=$database;host=/var/run/postgresql;port=$port";
-
-       my $dbh = DBI->connect($dsn, $> == 0 ? 'root' : 'www-data', undef,
-                              { PrintError => 0, RaiseError => 1 });
+       my $user = $> == 0 ? 'root' : 'www-data';
+       my $dbh = DBI->connect($dsn, $user, undef, { PrintError => 0, RaiseError => 1 });
 
        return $dbh;
     }