Skip to content

Commit 743911d

Browse files
committed
Improve repositores code
Signed-off-by: Michael Sverdlov <[email protected]>
1 parent 7423eb3 commit 743911d

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

artifactory/commands/python/poetry.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,11 @@ import (
2020

2121
type PoetryCommand struct {
2222
PythonCommand
23-
// The uniq Artifactory repository name for poetry config file.
24-
poetryConfigRepoName string
2523
}
2624

27-
const baseConfigRepoName = "jfrog-server"
28-
2925
func NewPoetryCommand() *PoetryCommand {
3026
return &PoetryCommand{
31-
PythonCommand: *NewPythonCommand(pythonutils.Poetry),
32-
poetryConfigRepoName: baseConfigRepoName,
27+
PythonCommand: *NewPythonCommand(pythonutils.Poetry),
3328
}
3429
}
3530

@@ -89,7 +84,7 @@ func (pc *PoetryCommand) install(buildConfiguration *buildUtils.BuildConfigurati
8984
}
9085

9186
func (pc *PoetryCommand) publish(buildConfiguration *buildUtils.BuildConfiguration, pythonBuildInfo *build.Build) error {
92-
publishCmdArgs := append(slices.Clone(pc.args), "-r "+pc.poetryConfigRepoName)
87+
publishCmdArgs := append(slices.Clone(pc.args), "-r "+pc.repository)
9388
// Collect build info by running the jf poetry install cmd
9489
pc.args = []string{}
9590
err := pc.install(buildConfiguration, pythonBuildInfo)
@@ -134,7 +129,7 @@ func (pc *PoetryCommand) SetPypiRepoUrlWithCredentials() error {
134129
rtUrl.Scheme+"://"+rtUrl.Host+rtUrl.Path,
135130
username,
136131
password,
137-
pc.poetryConfigRepoName)
132+
pc.repository)
138133
}
139134
return nil
140135
}

common/cliutils/utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ func CreateServerDetailsWithConfigOffer(createServerDetails func() (*config.Serv
217217
if err != nil {
218218
return nil, err
219219
}
220-
220+
log.Debug(fmt.Sprintf("Using <%s> server-id configuration", confDetails.ServerId))
221+
221222
// Take insecureTls value from options since it is not saved in config.
222223
confDetails.InsecureTls = details.InsecureTls
223224
confDetails.Url = clientUtils.AddTrailingSlashIfNeeded(confDetails.Url)

0 commit comments

Comments
 (0)