From 8ba6c40f0c36a6019e6b0e89d11da375f2716e14 Mon Sep 17 00:00:00 2001 From: Felix Frank Date: Tue, 5 Feb 2019 16:34:55 +0100 Subject: [PATCH] langpuppet: Fix Cli method invocations for wrapped GAPIs Since the langpuppet GAPI creates fresh new CliContext objects, it has to make sure to provide the original parent context, because the child GAPIs expect to be able to access its data. --- langpuppet/gapi.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/langpuppet/gapi.go b/langpuppet/gapi.go index 3f533830..e722956f 100644 --- a/langpuppet/gapi.go +++ b/langpuppet/gapi.go @@ -123,13 +123,13 @@ func (obj *GAPI) Cli(cliInfo *gapi.CliInfo) (*gapi.Deploy, error) { var langDeploy *gapi.Deploy var puppetDeploy *gapi.Deploy langCliInfo := &gapi.CliInfo{ - CliContext: cli.NewContext(c.App, flagSet, nil), + CliContext: cli.NewContext(c.App, flagSet, c.Parent()), Fs: fs, Debug: debug, Logf: logf, // TODO: wrap logf? } puppetCliInfo := &gapi.CliInfo{ - CliContext: cli.NewContext(c.App, flagSet, nil), + CliContext: cli.NewContext(c.App, flagSet, c.Parent()), Fs: fs, Debug: debug, Logf: logf, // TODO: wrap logf?