Browse Source

Merge pull request #831 from gravitl/hotfix_v0.11.0_listenport

ensure new listen port is written to config files
dcarns 3 years ago
parent
commit
34145288e5
2 changed files with 2 additions and 3 deletions
  1. 1 1
      netclient/functions/daemon.go
  2. 1 2
      netclient/functions/join.go

+ 1 - 1
netclient/functions/daemon.go

@@ -333,7 +333,7 @@ func getCommsNetworks(networks []string) (map[string]bool, error) {
 
 
 func getCommsCfgByNode(node *models.Node) config.ClientConfig {
 func getCommsCfgByNode(node *models.Node) config.ClientConfig {
 	var commsCfg config.ClientConfig
 	var commsCfg config.ClientConfig
-	commsCfg.Network = node.Network
+	commsCfg.Network = node.CommID
 	commsCfg.ReadConfig()
 	commsCfg.ReadConfig()
 	return commsCfg
 	return commsCfg
 }
 }

+ 1 - 2
netclient/functions/join.go

@@ -215,7 +215,7 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string, iscomms bool) error
 
 
 	setListenPort(oldListenPort, &cfg)
 	setListenPort(oldListenPort, &cfg)
 
 
-	err = config.ModConfig(&node)
+	err = config.ModConfig(&cfg.Node)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
@@ -298,7 +298,6 @@ func setListenPort(oldListenPort int32, cfg *config.ClientConfig) {
 		// if newListenPort has been modified to find an available port, publish to server
 		// if newListenPort has been modified to find an available port, publish to server
 		if cfg.Node.ListenPort != newListenPort {
 		if cfg.Node.ListenPort != newListenPort {
 			var currentCommsCfg = getCommsCfgByNode(&cfg.Node)
 			var currentCommsCfg = getCommsCfgByNode(&cfg.Node)
-			log.Println("DELETE ME: publishing update of port: " + string(cfg.Node.ListenPort))
 			PublishNodeUpdate(&currentCommsCfg, cfg)
 			PublishNodeUpdate(&currentCommsCfg, cfg)
 		}
 		}
 	}
 	}