[pmg-devel] [PATCH pmg-api 3/5] pmgsh: assemble ticket later

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Jul 29 14:45:10 CEST 2019


otherwise this fails when verifying the API in a clean build
environment, where no private key exists.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 src/bin/pmgsh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/pmgsh b/src/bin/pmgsh
index 63fc56a..b7d1558 100755
--- a/src/bin/pmgsh
+++ b/src/bin/pmgsh
@@ -25,8 +25,6 @@ PMG::RESTEnvironment->setup_default_cli_env();
 
 my $rpcenv = PMG::RESTEnvironment->get();
 
-my $ticket = PMG::Ticket::assemble_ticket('root at pam');
-
 my $logid = $ENV{PVE_LOG_ID} || 'pmgsh';
 initlog($logid);
 
@@ -456,6 +454,8 @@ sub pmg_command {
 
     $rpcenv->init_request();
 
+    my $ticket = PMG::Ticket::assemble_ticket('root at pam');
+
     $rpcenv->set_ticket($ticket);
     $rpcenv->set_user('root at pam');
     $rpcenv->set_role('root');
-- 
2.20.1




More information about the pmg-devel mailing list