From b41f50e249ae6acff75a1c7838229a922fc58b21 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 24 Dec 2008 04:31:55 +0000 Subject: Implement metadata connector functionality git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5000 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-info | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/sbin/bcfg2-info') diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index c0c2673a5..bf88b1bfe 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -24,12 +24,12 @@ def printTabular(rows): class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core): - def __init__(self, repo, plgs, struct, gens, passwd, svn, + def __init__(self, repo, plgs, struct, gens, conn, passwd, svn, encoding, event_debug): cmd.Cmd.__init__(self) try: Bcfg2.Server.Core.Core.__init__(self, repo, plgs, struct, gens, - passwd, svn, encoding) + conn, passwd, svn, encoding) if event_debug: self.fam.debug = True except Bcfg2.Server.Core.CoreInitError, msg: @@ -124,7 +124,7 @@ Usage: [quit|exit]""" if len(args.split()) == 2: fname, client = args.split() entry = lxml.etree.Element('ConfigFile', name=fname) - metadata = self.metadata.get_metadata(client) + metadata = self.build_metadata(client) self.Bind(entry, metadata) print lxml.etree.tostring(entry, encoding="UTF-8", xml_declaration=True) else: @@ -162,7 +162,7 @@ Usage: [quit|exit]""" return client = args.split()[0] try: - meta = self.metadata.get_metadata(client) + meta = self.build_metadata(client) except Bcfg2.Server.Plugins.Metadata.MetadataConsistencyError: print "Unable to find metadata for host %s" % client return @@ -268,7 +268,7 @@ Usage: [quit|exit]""" def do_cfgdebug(self, args): try: - meta = self.metadata.get_metadata(args) + meta = self.build_metadata(args) except Bcfg2.Server.Plugins.Metadata.MetadataConsistencyError: print "Unable to find metadata for host %s" % client return @@ -301,17 +301,15 @@ if __name__ == '__main__': 'generators': Bcfg2.Options.SERVER_GENERATORS, 'password': Bcfg2.Options.SERVER_PASSWORD, 'event debug': Bcfg2.Options.DEBUG, - 'encoding': Bcfg2.Options.ENCODING}) + 'encoding': Bcfg2.Options.ENCODING, + 'connectors': Bcfg2.Options.SERVER_MCONNECT}) setup = Bcfg2.Options.OptionParser(optinfo) setup.parse(sys.argv[1:]) - if "-d" in sys.argv: - loop = infoCore(setup['repo'], setup['plugins'], setup['structures'], - setup['generators'], setup['password'], setup['svn'], - setup['encoding'], True) - else: - loop = infoCore(setup['repo'], setup['plugins'], setup['structures'], - setup['generators'], setup['password'], setup['svn'], - setup['encoding'], False) + print setup + loop = infoCore(setup['repo'], setup['plugins'], setup['structures'], + setup['generators'], setup['connectors'], + setup['password'], setup['svn'], setup['encoding'], + '-d' in sys.argv) if "args" in setup and setup['args']: loop.onecmd(" ".join(setup['args'])) raise SystemExit(0) -- cgit v1.2.3-1-g7c22