X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fagent%2Fprojects.go;h=d316c20220eaf8aadba53e46c44c9dafac8e170a;hb=247bb7c2db5f0d48178398599348249bf886ebbc;hp=d6268fa03988ff54e98fdac885e018d083958ce3;hpb=89563054ea6305c7270dcc6ab6fa5b286eb5f742;p=src%2Fxds%2Fxds-agent.git diff --git a/lib/agent/projects.go b/lib/agent/projects.go index d6268fa..d316c20 100644 --- a/lib/agent/projects.go +++ b/lib/agent/projects.go @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 "IoT.bzh" + * Copyright (C) 2017-2018 "IoT.bzh" * Author Sebastien Douheret * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,11 +25,12 @@ import ( "strings" "time" + st "gerrit.automotivelinux.org/gerrit/src/xds/xds-agent.git/lib/syncthing" + "gerrit.automotivelinux.org/gerrit/src/xds/xds-server.git/lib/xsapiv1" + + "gerrit.automotivelinux.org/gerrit/src/xds/xds-agent.git/lib/xaapiv1" + common "gerrit.automotivelinux.org/gerrit/src/xds/xds-common.git" "github.com/franciscocpg/reflectme" - "github.com/iotbzh/xds-agent/lib/syncthing" - "github.com/iotbzh/xds-agent/lib/xaapiv1" - common "github.com/iotbzh/xds-common/golib" - "github.com/iotbzh/xds-server/lib/xsapiv1" "github.com/syncthing/syncthing/lib/sync" ) @@ -54,6 +55,7 @@ func NewProjects(ctx *Context, st *st.SyncThing) *Projects { // Init Load Projects configuration func (p *Projects) Init(server *XdsServer) error { + svrList := make(map[string]*XdsServer) // If server not set, load for all servers if server == nil { @@ -75,6 +77,11 @@ func (p *Projects) Init(server *XdsServer) error { for _, prj := range xFlds { newP := svr.FolderToProject(prj) if _, err := p.createUpdate(newP, false, true); err != nil { + // Don't consider that as an error (allow support config without CloudSync support) + if p.Context.SThg == nil && strings.Contains(err.Error(), "Server doesn't support project type CloudSync") { + continue + } + errMsg += "Error while creating project id " + prj.ID + ": " + err.Error() + "\n " continue }