diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-04 17:27:32 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-05 11:10:35 +0100 |
commit | d01746b3b667a85ddd8b68eb504abcd071006357 (patch) | |
tree | bf09d3f024eb5b01d5d9f72d638c007cabf7e727 /lib/xdsserver | |
parent | aafb8edbef7a285fd4937336f31d8e06e1fa0dca (diff) |
Move xds-project.conf file create to xds-agent.
Diffstat (limited to 'lib/xdsserver')
-rw-r--r-- | lib/xdsserver/apiv1-folders.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/xdsserver/apiv1-folders.go b/lib/xdsserver/apiv1-folders.go index 009d2ce..a395b80 100644 --- a/lib/xdsserver/apiv1-folders.go +++ b/lib/xdsserver/apiv1-folders.go @@ -19,7 +19,6 @@ package xdsserver import ( "net/http" - "os" "github.com/gin-gonic/gin" common "github.com/iotbzh/xds-common/golib" @@ -63,29 +62,6 @@ func (s *APIService) addFolder(c *gin.Context) { return } - // Create xds-project.conf file - // FIXME: move to folders.createUpdate func (but gin context needed) - fld := s.mfolders.Get(newFld.ID) - prjConfFile := (*fld).GetFullPath("xds-project.conf") - if !common.Exists(prjConfFile) { - fd, err := os.OpenFile(prjConfFile, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0666) - if err != nil { - common.APIError(c, err.Error()) - return - } - fd.WriteString("# XDS project settings\n") - fd.WriteString("export XDS_AGENT_URL=" + c.Request.Host + "\n") - fd.WriteString("export XDS_PROJECT_ID=" + newFld.ID + "\n") - if newFld.DefaultSdk == "" { - sdks := s.sdks.GetAll() - if len(sdks) > 0 { - newFld.DefaultSdk = sdks[0].ID - } - } - fd.WriteString("export XDS_SDK_ID=" + newFld.DefaultSdk + "\n") - fd.Close() - } - c.JSON(http.StatusOK, newFld) } |