From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] applied: [PATCH pmg-api] pmgsh: fix calling the api paths directly
Date: Fri, 7 Jul 2023 18:59:13 +0200 [thread overview]
Message-ID: <20230707185913.44d9f4a2@rosa.proxmox.com> (raw)
In-Reply-To: <20230703111548.5c30a5f9@rosa.proxmox.com>
On Mon, 3 Jul 2023 11:15:48 +0200
Stoiko Ivanov <s.ivanov@proxmox.com> wrote:
> Thanks for the fix!
> Applied with bug-reference and Fixes trailer added!
for the record - also cherry-picked it to stable-7 just now as the issue
was present there as well
>
>
> On Mon, 3 Jul 2023 10:28:19 +0200
> Dominik Csapak <d.csapak@proxmox.com> wrote:
>
> > if we get a command directly, we don't initialize the $rpcenv
> > variable anymore.
> >
> > To fix it, make it a local variable of the pmg_command function.
> > We now make one extra '->get()' call per command (as opposed to
> > once per program), but that shouldn't cost us anything really.
> >
> > Reported in the forum: https://forum.proxmox.com/threads/pmgsh-failing.130008/
> >
> > Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> > ---
> > src/bin/pmgsh | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/bin/pmgsh b/src/bin/pmgsh
> > index f9816cd..7499c42 100755
> > --- a/src/bin/pmgsh
> > +++ b/src/bin/pmgsh
> > @@ -78,7 +78,6 @@ if (scalar (@ARGV) != 0) {
> >
> > # only set up once actually required allows calling verifyapi in restriced clean sbuild env
> > PMG::RESTEnvironment->setup_default_cli_env();
> > -my $rpcenv = PMG::RESTEnvironment->get();
> > initlog($ENV{PVE_LOG_ID} || 'pmgsh');
> >
> > print "entering PMG shell - type 'help' for help\n";
> > @@ -451,6 +450,7 @@ sub list_dir {
> > sub pmg_command {
> > my ($args, $nooutput) = @_;
> >
> > + my $rpcenv = PMG::RESTEnvironment->get();
> > $rpcenv->init_request();
> >
> > my $ticket = PMG::Ticket::assemble_ticket('root@pam');
>
>
>
> _______________________________________________
> pmg-devel mailing list
> pmg-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel
>
>
prev parent reply other threads:[~2023-07-07 16:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-03 8:28 [pmg-devel] " Dominik Csapak
2023-07-03 8:30 ` Dominik Csapak
2023-07-03 9:15 ` [pmg-devel] applied: " Stoiko Ivanov
2023-07-07 16:59 ` Stoiko Ivanov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230707185913.44d9f4a2@rosa.proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox