summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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,','))