use correct path

This commit is contained in:
Kalle Carlbark 2021-11-26 11:15:19 +01:00
parent 89a5d96e64
commit 7fb583bd4e
No known key found for this signature in database
4 changed files with 27 additions and 8 deletions

18
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,18 @@
repos:
- repo: https://git.candidator.se/go/dev-tools/pre-commit-golang.git
rev: f898003d6bfc677c18ee10210eb663fa5394cfb5
hooks:
- id: go-fmt
- id: go-vet
- id: go-staticcheck
- id: go-imports
- id: go-cyclo
args: [-over=100]
- id: revive
- id: gosec
- id: validate-toml
- id: no-go-testing
# - id: golangci-lint
- id: go-critic
- id: go-unit-tests
- id: go-build

View file

@ -171,11 +171,11 @@ type Device struct {
}
type NewDevice struct {
Name string `json:"name,omitempty,omitempty"`
DeviceType int `json:"device_type,omitempty,omitempty"`
DeviceRole int `json:"device_role,omitempty,omitempty"`
Tenant int `json:"tenant,omitempty,omitempty"`
Platform int `json:"platform,omitempty,omitempty"`
Name string `json:"name,omitempty"`
DeviceType int `json:"device_type,omitempty"`
DeviceRole int `json:"device_role,omitempty"`
Tenant int `json:"tenant,omitempty"`
Platform int `json:"platform,omitempty"`
Serial string `json:"serial,omitempty"`
AssetTag string `json:"asset_tag,omitempty"`
Site int `json:"site,omitempty"`
@ -257,7 +257,7 @@ type UpdateDevice struct {
DcimDeviceBelongsToService int `json:"dcim_device_belongs_to_service,omitempty"`
DcimDeviceCendotid string `json:"dcim_device_cendotid,omitempty"`
DcimDeviceExposedToInternet int `json:"dcim_device_exposed_to_internet,omitempty"`
DcimDeviceImportOsVersion bool `json:"dcim_device_import_os_version,omitempty,omitempty"`
DcimDeviceImportOsVersion bool `json:"dcim_device_import_os_version,omitempty"`
DcimDevicePod int `json:"dcim_device_pod,omitempty"`
} `json:"custom_fields,omitempty"`
}

View file

@ -149,7 +149,7 @@ func NewClient(apiurl string, httpClient *http.Client) (*Client, error) {
c.DeviceRoles = (*DeviceRolesService)(&c.common)
c.DeviceTypes = (*DeviceTypesService)(&c.common)
c.Interfaces = (*InterfacesService)(&c.common)
c.InventoryItems = (*InventoryItemsServices)(&c.common)
c.InventoryItems = (*InventoryItemsService)(&c.common)
c.Prefixes = (*PrefixesService)(&c.common)
c.RearPorts = (*RearPortsService)(&c.common)
c.Tenants = (*TenantsService)(&c.common)
@ -185,6 +185,7 @@ func (n *Client) FetchSessionKey(privatekey string) error {
query := form.Encode()
transport := &http.Transport{
// #nosec XXX: FIXIT
TLSClientConfig: &tls.Config{InsecureSkipVerify: n.InsecureSkipVerify},
}
timeout := time.Duration(60 * time.Second)

View file

@ -87,7 +87,7 @@ func (s *SecretsService) List(ctx context.Context, f *SecretFilter) (*Secrets, e
}
query = form.Encode()
req, err = s.client.newRequest(ctx, "GET", devicesPath, query, nil)
req, err = s.client.newRequest(ctx, "GET", secretsPath, query, nil)
if err != nil {
return &secrets, err
}