Merge pull request #5741 from yousong/automated-cherry-pick-of-#5740-upstream-release-3.1

Automated cherry pick of #5740: region: lbagents: fix returning error when glob has no match
This commit is contained in:
yunion-ci-robot
2020-04-10 09:53:42 +08:00
committed by GitHub
@@ -160,7 +160,7 @@ func (lbagent *SLoadbalancerAgent) deploy(ctx context.Context, userCred mcclient
return nil, errors.WithMessagef(err, "glob error %s", pattern)
}
if len(matches) == 0 {
return nil, errors.WithMessagef(err, "glob nomatch %s", pattern)
return nil, errors.Errorf("no match for %q", pattern)
}
path := matches[len(matches)-1]
name := filepath.Base(path)