client session add context

This commit is contained in:
wanyaoqi
2018-12-24 21:17:46 +08:00
parent f034ce6629
commit 742a67b0f8
29 changed files with 105 additions and 71 deletions

View File

@@ -30,7 +30,7 @@ type SSHtoolSol struct {
func getCommand(ctx context.Context, userCred mcclient.TokenCredential, ip string) (string, *BaseCommand, error) {
cmd := NewBaseCommand(o.Options.SshToolPath)
s := auth.GetAdminSession(o.Options.Region, "v2")
s := auth.GetAdminSession(ctx, o.Options.Region, "v2")
key, err := modules.Sshkeypairs.GetById(s, userCred.GetProjectId(), jsonutils.Marshal(map[string]bool{"admin": true}))
if err != nil {
return "", nil, err