Fix a null-pointer bug in wwctl upgrade config
Also removing some vestigial development-debug output. Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -176,7 +176,7 @@ func (this *NFSExportConf) Upgrade() (upgraded *config.NFSExportConf) {
|
||||
upgraded = new(config.NFSExportConf)
|
||||
upgraded.Path = this.Path
|
||||
upgraded.ExportOptions = this.ExportOptions
|
||||
if *(this.Mount) {
|
||||
if this.Mount != nil && *(this.Mount) {
|
||||
wwlog.Warn("Legacy mount configured for NFS export %s: use `wwctl upgrade nodes --with-warewulfconf=<original file>` to port to nodes.conf", this.Path)
|
||||
}
|
||||
return upgraded
|
||||
|
||||
@@ -97,7 +97,6 @@ func (this *NodesYaml) Upgrade(addDefaults bool, replaceOverlays bool, warewulfc
|
||||
if warewulfconf != nil && warewulfconf.NFS != nil {
|
||||
var fstab []map[string]string
|
||||
for _, export := range warewulfconf.NFS.Exports {
|
||||
fmt.Printf("PORTING EXPORT: %s\n", export)
|
||||
fstab = append(fstab, map[string]string{
|
||||
"spec": fmt.Sprintf("warewulf:%s", export),
|
||||
"file": export,
|
||||
@@ -117,7 +116,6 @@ func (this *NodesYaml) Upgrade(addDefaults bool, replaceOverlays bool, warewulfc
|
||||
fstab = append(fstab, entry)
|
||||
}
|
||||
}
|
||||
fmt.Printf("FSTAB: %+v\n", fstab)
|
||||
if len(fstab) > 0 {
|
||||
if _, ok := upgraded.NodeProfiles["default"]; !ok {
|
||||
upgraded.NodeProfiles["default"] = new(node.Profile)
|
||||
|
||||
Reference in New Issue
Block a user