Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide registry resource method #215

Merged
merged 2 commits into from
Mar 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Provide registry resource method
Signed-off-by: Antonia Avramova <antonia.avramova@bosch.io>
antonia-avramova committed Mar 28, 2023
commit 262b0200b2a22722522f2f2e1196e39482dbcb38
6 changes: 3 additions & 3 deletions integration/util/registry.go
Original file line number Diff line number Diff line change
@@ -102,13 +102,13 @@ func getCredentialsBody(authID, pass string) string {
return string(data)
}

// RegisterDeviceResources registers all given resources. If some error ocurred delete resources.
// RegisterDeviceResources registers all given resources. In case of error all resources registered by this function will be deleted.
func RegisterDeviceResources(cfg *TestConfiguration,
resources []*Resource, deviceId, url, user, pass string) error {
resources []*Resource, deviceID, url, user, pass string) error {
for i, r := range resources {
if _, err := SendDeviceRegistryRequest(([]byte)(r.Body), r.Method, r.URL, r.User, r.Pass); err != nil {
if i > 0 {
DeleteResources(cfg, resources[:i], deviceId, url, user, pass)
DeleteResources(cfg, resources[:i], deviceID, url, user, pass)
}
return err
}