From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Teigland Date: Fri, 4 Sep 2009 13:06:12 -0500 Subject: [Cluster-devel] ccs_config_dump / ccs_config_validate In-Reply-To: <1252086256.6387.25.camel@cerberus.int.fabbione.net> References: <20090903192244.GB23923@redhat.com> <1252045015.339.139.camel@cerberus.int.fabbione.net> <20090904153753.GA26463@redhat.com> <1252086256.6387.25.camel@cerberus.int.fabbione.net> Message-ID: <20090904180612.GB26463@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Sep 04, 2009 at 07:44:16PM +0200, Fabio M. Di Nitto wrote: > > ccs_config_validate /path/to/file > > . just xmllint on file > > . (do not load file into any libs) > > > > ccs_config_validate --load-test /path/to/file > > . load file into xmlconfig and cmanpreconfig > > . dump result to tmpfile > > . xmllint tmpfile > > . rm tmpfile > > > > ccs_config_validate --load-test > > . depending on /etc/sysconfig/ > > . load /etc/cluster/cluster.conf into xmlconfig and cmanpreconfig, or > > . load other source like ldap into cmanpreconfig > > . dump result to tmpfile > > . xmllint tmpfile > > . rm tmpfile > > Ok now I see what you mean. It's easily doable. I was planning to add > help and options support to ccs_config_validate anyway. > > All of the above is easily doable, but I think i would still prefer to > have the --load-test by default because it's what is really going to run > on the cluster and document maybe a --validate-file to validate only the > file since it is a special case (there is no easy equivalent for ldap or > other loaders at the moment). Dunno, I'm just trying to put myself in the place of the user using these tools and thinking about what would make most sense to them. We optimize the usage for them, not for code that calls the tools. Perhaps we should have both: ccs_config_validate --test-file /path/to/file . validates the file directly ccs_config_validate --test-load [/path/to/file] . validates the file after passing it through config libs which add default values that are not specified in file . without file, /etc/sysconfig is used to determine the config source, e.g. /etc/cluster/cluster.conf, or ldap Then I wouldn't mind ccs_config_validate called with no options or args to default to the later. In that case it would be nice to see it print the full command that it's actually running, just to remove some of the "magical" quality, e.g. > ccs_config_validate ccs_config_validate --test-load /etc/cluster/cluster.conf ok Dave