mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 20:05:46 +08:00
review comments
This commit is contained in:
parent
62cd313bd6
commit
d0af730042
1 changed files with 2 additions and 5 deletions
|
@ -331,7 +331,7 @@ func CheckHostPorts(h *models.Host) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkPort(h *models.Host, p int) int {
|
func checkPort(h *models.Host, p int) int {
|
||||||
currentPort := h.ListenPort
|
currentPort := p
|
||||||
count := 0
|
count := 0
|
||||||
hosts, err := GetAllHosts()
|
hosts, err := GetAllHosts()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -361,10 +361,7 @@ func checkPort(h *models.Host, p int) int {
|
||||||
// HostExists - checks if given host already exists
|
// HostExists - checks if given host already exists
|
||||||
func HostExists(h *models.Host) bool {
|
func HostExists(h *models.Host) bool {
|
||||||
_, err := GetHost(h.ID.String())
|
_, err := GetHost(h.ID.String())
|
||||||
if (err != nil && !database.IsEmptyRecord(err)) || (err == nil) {
|
return (err != nil && !database.IsEmptyRecord(err)) || (err == nil)
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func updatePort(p *int) {
|
func updatePort(p *int) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue