From 07d39c2e496727bc130510069f111828c071953e Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Tue, 7 Mar 2023 11:49:09 +0100 Subject: [PATCH] moved location of defaults.conf Signed-off-by: Christian Goll --- Makefile | 6 +++--- go.mod | 1 - go.sum | 2 -- internal/pkg/node/constructors.go | 8 +------- internal/pkg/warewulfconf/constructors.go | 2 -- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 1093f65a..c50baae9 100644 --- a/Makefile +++ b/Makefile @@ -183,7 +183,7 @@ files: all test -f $(DESTDIR)$(WWCONFIGDIR)/wwapic.conf || install -m 644 etc/wwapic.conf $(DESTDIR)$(WWCONFIGDIR) test -f $(DESTDIR)$(WWCONFIGDIR)/wwapid.conf || install -m 644 etc/wwapid.conf $(DESTDIR)$(WWCONFIGDIR) test -f $(DESTDIR)$(WWCONFIGDIR)/wwapird.conf || install -m 644 etc/wwapird.conf $(DESTDIR)$(WWCONFIGDIR) - test -f $(DESTDIR)$(WWCONFIGDIR)/defaults.conf || ./wwctl genconfig defaults > $(DESTDIR)$(WWCONFIGDIR)/defaults.conf + test -f $(DESTDIR)$(DATADIR)/warewulf/defaults.conf || ./wwctl --emptyconf genconfig defaults > $(DESTDIR)$(DATADIR)/warewulf/defaults.conf cp -r etc/examples $(DESTDIR)$(WWCONFIGDIR)/ cp -r etc/ipxe $(DESTDIR)$(WWCONFIGDIR)/ cp -r overlays/* $(DESTDIR)$(WWOVERLAYDIR)/ @@ -229,7 +229,7 @@ wwclient: $(WWCLIENT_DEPS) man_pages: wwctl install -d man_pages - ./wwctl genconfig man man_pages + ./wwctl --emptyconf genconfig man man_pages cp docs/man/man5/*.5 ./man_pages/ cd man_pages; for i in wwctl*1 *.5; do echo "Compressing manpage: $$i"; gzip --force $$i; done @@ -246,7 +246,7 @@ dist: vendor config rm -rf .dist reference: wwctl - ./wwctl genconfig reference userdocs/reference/ + ./wwctl --emptyconf genconfig reference userdocs/reference/ latexpdf: reference make -C userdocs latexpdf diff --git a/go.mod b/go.mod index 6159de0c..34b3a458 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/hpcng/warewulf go 1.16 require ( - github.com/brotherpowers/ipsubnet v0.0.0-20170914094241-30bc98f0a5b1 github.com/containers/image/v5 v5.7.0 github.com/containers/storage v1.30.0 github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e diff --git a/go.sum b/go.sum index a58cfc27..829c8f81 100644 --- a/go.sum +++ b/go.sum @@ -104,8 +104,6 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/brotherpowers/ipsubnet v0.0.0-20170914094241-30bc98f0a5b1 h1:80OMQcGycPqKFFabSaxOagCh7mgspnMl/X3YGmNi+j0= -github.com/brotherpowers/ipsubnet v0.0.0-20170914094241-30bc98f0a5b1/go.mod h1:mm9ZF6W76SwZtJpYzrVmTMuzmIhPX0SIuEosW/OTFd4= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= diff --git a/internal/pkg/node/constructors.go b/internal/pkg/node/constructors.go index 89079144..10ee86ad 100644 --- a/internal/pkg/node/constructors.go +++ b/internal/pkg/node/constructors.go @@ -44,7 +44,7 @@ func init() { ConfigFile = path.Join(conf.Paths.Sysconfdir, "warewulf/nodes.conf") } if DefaultConfig == "" { - DefaultConfig = path.Join(conf.Paths.Sysconfdir, "warewulf/defaults.conf") + DefaultConfig = path.Join(conf.Paths.Datadir, "warewulf/defaults.conf") } cachedDB.current = false cachedDB.persist = true @@ -114,12 +114,6 @@ for every node */ func (config *NodeYaml) FindAllNodes() ([]NodeInfo, error) { var ret []NodeInfo - /* - wwconfig, err := warewulfconf.New() - if err != nil { - return ret, err - } - */ var defConf map[string]*NodeConf wwlog.Verbose("Opening defaults from file failed %s\n", DefaultConfig) defData, err := os.ReadFile(DefaultConfig) diff --git a/internal/pkg/warewulfconf/constructors.go b/internal/pkg/warewulfconf/constructors.go index 217b8cfc..2a1e0ff0 100644 --- a/internal/pkg/warewulfconf/constructors.go +++ b/internal/pkg/warewulfconf/constructors.go @@ -33,7 +33,6 @@ func New() (conf ControllerConf) { cachedConf = conf cachedConf.readConf = false cachedConf.current = true - } else { // If cached struct isn't empty, use it as the return value conf = cachedConf @@ -101,7 +100,6 @@ func (conf *ControllerConf) SetDynamicDefaults() (err error) { _, network, err = net.ParseCIDR(conf.Ipaddr) if err == nil { mask = network.Mask - fmt.Println(mask) } else { return errors.Wrap(err, "Couldn't parse IP address") }