You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2018/08/28 15:03:09 UTC
[trafficcontrol] 14/14: check for no cache group
This is an automated email from the ASF dual-hosted git repository.
dewrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit aec6386963456f3d6cd957ac1564978e155304ab
Author: Dan Kirkwood <da...@apache.org>
AuthorDate: Tue Aug 28 08:42:32 2018 -0600
check for no cache group
---
infrastructure/cdn-in-a-box/enroller/enroller.go | 3 +++
1 file changed, 3 insertions(+)
diff --git a/infrastructure/cdn-in-a-box/enroller/enroller.go b/infrastructure/cdn-in-a-box/enroller/enroller.go
index 19613ba..3efcdd8 100644
--- a/infrastructure/cdn-in-a-box/enroller/enroller.go
+++ b/infrastructure/cdn-in-a-box/enroller/enroller.go
@@ -152,6 +152,9 @@ func (s *session) getCachegroupID() (int, error) {
fmt.Println("cannot get Cachegroup")
return -1, err
}
+ if len(cgs) == 0 {
+ return -1, errors.New("No cachegroups found")
+ }
return cgs[0].ID, err
}