- def initNS(self):
- # Obtain a reference to the root naming context
- obj = self.orb.resolve_initial_references("NameService")
- try:
- self.rootContext = obj._narrow(CosNaming.NamingContext)
- return
- except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE):
- print "It's not a valid naming service"
- self.rootContext = None
- raise
+ def initNS(self,args):
+ # Obtain a reference to the root naming context
+ obj = self.orb.resolve_initial_references("NameService")
+ try:
+ self.rootContext = obj._narrow(CosNaming.NamingContext)
+ return
+ except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE):
+ print "It's not a valid naming service"
+ self.rootContext = None
+ raise
+#
+
+def startClient():
+ try:
+ clt=client()
+ except Exception:
+ sys.exit(1)
+ #
+ print "Naming Service address: ",clt.orb.object_to_string(clt.rootContext)