Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Open
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
32ec11b
work in progress commit
Slach Mar 15, 2018
ad5b6a8
Merge branch 'add_docker_and_vagrant' into reanimate_api
Slach Mar 17, 2018
0d08d34
extract some LVM related commands into customizable config parameters
Slach Mar 17, 2018
56e4362
add customizable MySQLTailErrorLogCommand
Slach Mar 18, 2018
caa8db6
add backward compatibility for old orchestrator post-copy call
Slach Mar 18, 2018
de935cc
Merge branch 'master' of github.com:github/orchestrator-agent into re…
Slach Mar 18, 2018
ac7cf93
add customizable GetLogicalVolumeFSTypeCommand
Slach Mar 18, 2018
0d74d97
add include /etc/ files for iject DAEMONOPTS or other settings before…
Slach Mar 19, 2018
3055395
add config reload by SIGHUP
Slach Mar 21, 2018
5d1b823
fix MySQLTailErrorLogCommand
Slach Mar 21, 2018
fb2e214
add reload and kill TERM without HUP ;)
Slach Mar 21, 2018
16f920c
extract const SeedTransferPort to configurable parameter
Slach Mar 21, 2018
0772999
add sudoCmd to send \ receive seed data commands
Slach Mar 21, 2018
b2d10ed
add backward compatibility to postCopy
Slach Mar 21, 2018
46468cd
add backward compatibility to postCopy
Slach Mar 21, 2018
9450b7d
add /etc/profile.d/orchestrator-agent usage
Slach Mar 21, 2018
66cb2a2
fixed Docker entrypoint after code review
Slach Mar 29, 2018
5c0dddb
return rsync folder mounting mode back
Slach Mar 29, 2018
8febb27
return blocking behavior
Slach Mar 29, 2018
17700a7
get sourceHost via query string
Slach Mar 31, 2018
4056d58
parse sourceHost over http.Request.URL.Query
Slach Mar 31, 2018
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
4 changes: 4 additions & 0 deletions go/http/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ func (this *HttpAPI) PostCopy(params martini.Params, r render.Render, req *http.
if err := this.validateToken(r, req); err != nil {
return
}
qs := req.URL.Query()
if sourceHost, exists := params["sourceHost"]; !exists || sourceHost=="" {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In golang, if the value does not exist in the map, then the returned value is "" anyway. So you can rewrite as:

if sourceHost := params["sourceHost"]; sourceHost == "" {

params["sourceHost"] = qs.Get("sourceHost")
}
err := osagent.PostCopy(params["sourceHost"])
if err != nil {
r.JSON(500, &APIResponse{Code: ERROR, Message: err.Error()})
Expand Down