mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
Merge pull request #2912 from wanyaoqi/feature/wyq/fix-init-listen-interface
bugfix: fix init listen interface
This commit is contained in:
@@ -139,11 +139,6 @@ func (h *SHostInfo) parseConfig() error {
|
||||
if h.GetMemory() < 64 { // MB
|
||||
return fmt.Errorf("Not enough memory!")
|
||||
}
|
||||
if len(options.HostOptions.ListenInterface) > 0 {
|
||||
h.MasterNic = netutils2.NewNetInterface(options.HostOptions.ListenInterface)
|
||||
} else {
|
||||
h.MasterNic = nil
|
||||
}
|
||||
for _, n := range options.HostOptions.Networks {
|
||||
nic, err := NewNIC(n)
|
||||
if err != nil {
|
||||
@@ -156,6 +151,14 @@ func (h *SHostInfo) parseConfig() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if len(options.HostOptions.ListenInterface) > 0 {
|
||||
h.MasterNic = netutils2.NewNetInterface(options.HostOptions.ListenInterface)
|
||||
if len(h.MasterNic.Addr) == 0 {
|
||||
return fmt.Errorf("Listen interface %s master not have IP", options.HostOptions.ListenInterface)
|
||||
}
|
||||
} else {
|
||||
h.MasterNic = nil
|
||||
}
|
||||
|
||||
if man, err := isolated_device.NewManager(h); err != nil {
|
||||
return fmt.Errorf("NewIsolatedManager: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user