From 7ed096175058ef26b8422b5100d83d9c053aa2b0 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 8 Dec 2004 03:03:13 +0000 Subject: Delete: src/bcfg2meta }(Logical change 1.158) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@703 ce84e21b-d406-0410-9b95-82705330c041 --- src/bcfg2meta | 57 --------------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/bcfg2meta (limited to 'src') diff --git a/src/bcfg2meta b/src/bcfg2meta deleted file mode 100644 index 4b5e94a97..000000000 --- a/src/bcfg2meta +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python - -# $Id: $ - -from getopt import getopt, GetoptError -from string import join -from sys import argv, exit - -from Metadata import MetadataStore - -def dgetopt(arglist, opt, vopt): - r = {} - for o in opt.values() + vopt.values(): - r[o] = False - gstr = join(opt.keys()) + join([x+':' for x in vopt.keys()]) - try: - (o, a) = getopt(arglist, gstr) - except GetoptError, g: - print g - print "bcfg2 Usage:" - for (k,v) in opt.iteritems(): - print " -%s %s"%(k,v) - for (k,v) in vopt.iteritems(): - print " -%s <%s>"%(k,v) - exit(1) - for (gopt,garg) in o: - option = gopt[1:] - if opt.has_key(option): - r[opt[option]] = True - else: - r[vopt[option]] = garg - return r - -class StaticMetadataStore(MetadataStore): - def __init__(self, filename): - self.data = open(filename).read() - self.Index() - -if __name__ == '__main__': - vopts = {'g':'get', 's':'set', 'i':'image', 'c':'classes'} - setup = dgetopt(argv[1:], {}, vopts) - - ops = filter(lambda x:setup[x], ['get','set']) - if len(filter(lambda x:setup[x], ['get','set'])) != 1: - print "confused" - exit(1) - - op = ops[0] - - data = StaticMetadataStore('/home/desai/data/b2/common/metadata.xml') - - client = setup[op] - - if op == 'get': - if data.clients.has_key(client): - m = data.clients[client] - print "Host: %s\t\tImage: %s\n\tClasses: %s\n\tBundles: %s"%(client, m.image, join(m.classes,','), join(m.bundles,',')) -- cgit v1.2.3-1-g7c22