region: lbagents: fix returning error when glob has no match

This commit is contained in:
Yousong Zhou
2020-04-09 11:08:03 +08:00
parent d07d8f9652
commit 7e2a369fae
@@ -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)