hostman: resolve ovn db address before setting it into ovsdb

This commit is contained in:
Yousong Zhou
2020-02-28 11:43:12 +08:00
parent df94352e00
commit c76062406d
+6
View File
@@ -22,6 +22,7 @@ import (
"yunion.io/x/onecloud/pkg/hostman/options"
"yunion.io/x/onecloud/pkg/hostman/system_service"
"yunion.io/x/onecloud/pkg/util/netutils2"
"yunion.io/x/onecloud/pkg/util/ovsutils"
"yunion.io/x/onecloud/pkg/util/procutils"
)
@@ -80,6 +81,11 @@ func (oh *OvnHelper) mustPrepOvsdbConfig() {
if opts.OvnSouthDatabase == "" {
panic(errors.Wrap(ErrOvnConfig, "bad config: ovn_south_database"))
}
db, err := ovsutils.NormalizeDbHost(opts.OvnSouthDatabase)
if err != nil {
panic(errors.Wrap(err, "normalize db host"))
}
opts.OvnSouthDatabase = db
args = append(args, fmt.Sprintf("external_ids:ovn-remote=%s",
opts.OvnSouthDatabase))
}