diff options
author | Michael Muré <batolettre@gmail.com> | 2020-02-15 03:06:10 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-02-15 03:07:45 +0100 |
commit | 432a816dde18a12c1479ed8151a11c29929476e0 (patch) | |
tree | 89c965c63f07c1091ff34ec3d163171a73eba29f /bridge/launchpad/config.go | |
parent | e9aff2a2a103b43852ecf7b57ae9ab297890eeed (diff) | |
parent | 362c0c7e2e1ce9a8e2918376a340c76f46569d64 (diff) | |
download | git-bug-432a816dde18a12c1479ed8151a11c29929476e0.tar.gz |
Merge remote-tracking branch 'origin/master' into cheshirekow-jira
Diffstat (limited to 'bridge/launchpad/config.go')
-rw-r--r-- | bridge/launchpad/config.go | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/bridge/launchpad/config.go b/bridge/launchpad/config.go index e029fad3..8567675f 100644 --- a/bridge/launchpad/config.go +++ b/bridge/launchpad/config.go @@ -13,18 +13,14 @@ import ( var ErrBadProjectURL = errors.New("bad Launchpad project URL") -func (l *Launchpad) Configure(repo *cache.RepoCache, params core.BridgeParams) (core.Configuration, error) { - if params.TokenRaw != "" { - fmt.Println("warning: token params are ineffective for a Launchpad bridge") - } - if params.Owner != "" { - fmt.Println("warning: --owner is ineffective for a Launchpad bridge") - } - if params.BaseURL != "" { - fmt.Println("warning: --base-url is ineffective for a Launchpad bridge") +func (Launchpad) ValidParams() map[string]interface{} { + return map[string]interface{}{ + "URL": nil, + "Project": nil, } +} - conf := make(core.Configuration) +func (l *Launchpad) Configure(repo *cache.RepoCache, params core.BridgeParams) (core.Configuration, error) { var err error var project string @@ -52,8 +48,9 @@ func (l *Launchpad) Configure(repo *cache.RepoCache, params core.BridgeParams) ( return nil, fmt.Errorf("project doesn't exist") } + conf := make(core.Configuration) conf[core.ConfigKeyTarget] = target - conf[keyProject] = project + conf[confKeyProject] = project err = l.ValidateConfig(conf) if err != nil { @@ -70,8 +67,8 @@ func (*Launchpad) ValidateConfig(conf core.Configuration) error { return fmt.Errorf("unexpected target name: %v", v) } - if _, ok := conf[keyProject]; !ok { - return fmt.Errorf("missing %s key", keyProject) + if _, ok := conf[confKeyProject]; !ok { + return fmt.Errorf("missing %s key", confKeyProject) } return nil |