def main(): locator = Service("locator") try: yield locator.connect() except: print "1; error while connect to locator" exit(1) try: chan = yield locator.resolve("graphite") result = yield chan.rx.get() except: print "2; error while resolv service graphite" exit(1) print "0;Ok"