Fix compilation after Id changing

This commit is contained in:
Jeff Mitchell committed 2020-05-05 14:13:08 -04:00
1 parent f36f25a23b
commit 11f640a0f8
3 files changed
+7 -7

No files matched your search

+4 -4
View File
@@ -12,11 +12,11 @@ func (s HostCatalog) CreateHost(ctx context.Context, host *Host) (*Host, *api.Er
if s.Client == nil {
return nil, nil, fmt.Errorf("nil client in CreateHost request")
}
if s.Id == nil || *s.Id == "" {
if s.Id == "" {
return nil, nil, fmt.Errorf("missing catalog ID in CreateHost request")
}
req, err := s.Client.NewRequest(ctx, "PUT", fmt.Sprintf("host-catalogs/%s/hosts", *s.Id), host)
req, err := s.Client.NewRequest(ctx, "PUT", fmt.Sprintf("host-catalogs/%s/hosts", s.Id), host)
if err != nil {
return nil, nil, fmt.Errorf("error creating CreateHost request: %w", err)
}
@@ -39,11 +39,11 @@ func (s HostCatalog) CreateHostSet(ctx context.Context, hostset *HostSet) (*Host
if s.Client == nil {
return nil, nil, fmt.Errorf("nil client in CreateHostSet request")
}
if s.Id == nil || *s.Id == "" {
if s.Id == "" {
return nil, nil, fmt.Errorf("missing catalog ID in CreateHostSet request")
}
req, err := s.Client.NewRequest(ctx, "PUT", fmt.Sprintf("host-catalogs/%s/host-sets", *s.Id), hostset)
req, err := s.Client.NewRequest(ctx, "PUT", fmt.Sprintf("host-catalogs/%s/host-sets", s.Id), hostset)
if err != nil {
return nil, nil, fmt.Errorf("error creating CreateHostSet request: %w", err)
}
+2 -2
View File
@@ -70,11 +70,11 @@ func (s {{ .BaseType }}) Create{{ .TargetType }}(ctx context.Context, {{ .LowerT
if s.Client == nil {
return nil, nil, fmt.Errorf("nil client in Create{{ .TargetType }} request")
}
if s.Id == nil || *s.Id == "" {
if s.Id == "" {
return nil, nil, fmt.Errorf("missing catalog ID in Create{{ .TargetType }} request")
}
req, err := s.Client.NewRequest(ctx, "{{ .Verb }}", fmt.Sprintf("{{ .Path }}", *s.Id), {{ .LowerTargetType }})
req, err := s.Client.NewRequest(ctx, "{{ .Verb }}", fmt.Sprintf("{{ .Path }}", s.Id), {{ .LowerTargetType }})
if err != nil {
return nil, nil, fmt.Errorf("error creating Create{{ .TargetType }} request: %w", err)
}
+1 -1
View File
@@ -113,7 +113,7 @@ func (c *CreateCommand) Run(args []string) int {
catalog := &hosts.HostCatalog{
Client: client,
Id: api.String(c.flagCatalogId),
Id: c.flagCatalogId,
}
host := &hosts.Host{