summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2004-12-08 03:03:13 +0000
committerNarayan Desai <desai@mcs.anl.gov>2004-12-08 03:03:13 +0000
commit7ed096175058ef26b8422b5100d83d9c053aa2b0 (patch)
tree830b6c2a80331507c54605c808e6bee032c7ecd4
parente80f01a50c0fc7aa05d970b95730e9e0864cb59c (diff)
downloadbcfg2-7ed096175058ef26b8422b5100d83d9c053aa2b0.tar.gz
bcfg2-7ed096175058ef26b8422b5100d83d9c053aa2b0.tar.bz2
bcfg2-7ed096175058ef26b8422b5100d83d9c053aa2b0.zip
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
-rw-r--r--src/bcfg2meta57
1 files changed, 0 insertions, 57 deletions
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,','))