Hello,

I'm about to add script

        /usr/bin/spacewalk-cfg-get

to spacewalk-backend-tools. The script can be used to reliably retrieve
configuration values from /etc/rhn/rhn.conf from non-Python
environments, without having to do grep or awk, which have potential
issues with commented lines, etc. This script uses rhnConfig to
it should to the right thing.

The script is as simple as

        #!/usr/bin/python

        import sys
        sys.path.append("/usr/share/rhn")

        from common.rhnConfig import RHNOptions

        cfg = RHNOptions()
        cfg.parse()

        for i in sys.argv :
                val = cfg.get(i)
                if val != None :
                        print val

Please shout if you do not like the idea if such a thing landing
in Spacewalk repo tomorrow.

Also, Mirek said he would like to use such a thing in Proxy but
proxy only uses spacewalk-backend, not spacewalk-backend-tools.
Would you object having such a /usr/bin script in spacewalk-backend?
Presently the package only owns /etc/rhn/default/rhn.conf
and /usr/share/rhn/common/* files.

-- 
Jan Pazdziora | adelton at #satellite*, #brno
Satellite Engineering, Red Hat

_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to