Index: fedd/fedd_client.py
===================================================================
--- fedd/fedd_client.py	(revision 23dec62633bcb34c43ec1c951f9e3830f25bb784)
+++ fedd/fedd_client.py	(revision a3ad8bda151c4074b1e9fa5731eea8514bf0c1c2)
@@ -82,4 +82,11 @@
         self.add_option("--trace", action="store_const", dest="tracefile", 
                 const=sys.stderr, help="Print SOAP exchange to stderr")
+class fedd_new_opts(fedd_client_opts):
+    def __init__(self):
+        fedd_client_opts.__init__(self)
+        self.add_option("-e", "--experiment_cert", dest="out_certfile",
+                type="string", help="output certificate file")
+        self.add_option("-E", "--experiment_name", dest="exp_name",
+                type="string", help="Suggested experiment name")
 
 class fedd_create_opts(fedd_client_opts):
@@ -1314,12 +1321,11 @@
                 sys.exit("No log returned")
 
-class create(fedd_rpc):
+class new(fedd_rpc):
     def __init__(self): 
-        fedd_rpc.__init__(self, "Create")
+        fedd_rpc.__init__(self, "New")
     def __call__(self):
         access_keys = []
         # Process the options using the customized option parser defined above
-        parser = fedd_create_opts(access_keys, self.add_ssh_key,
-                self.add_x509_cert)
+        parser = fedd_new_opts()
 
         (opts, args) = parser.parse_args()
@@ -1329,12 +1335,7 @@
                 sys.exit("Cannot read trusted certificates (%s)" % opts.trusted)
 
-        if not opts.project :
-            parser.error('--project is required')
-
         if opts.debug > 0: opts.tracefile=sys.stderr
 
         (user, cert) = self.get_user_info(access_keys)
-
-        if opts.user: user = opts.user
 
         if opts.cert != None: cert = opts.cert
@@ -1345,35 +1346,10 @@
         if os.access(cert, os.R_OK):
             fid = fedid(file=cert)
-            if opts.use_fedid == True:
-                user = fid
         else:
             sys.exit("Cannot read certificate (%s)" % cert)
 
-        if opts.file:
-            exp_desc = ""
-            try:
-                f = open(opts.file, 'r')
-                for line in f:
-                    exp_desc += line
-                f.close()
-            except IOError:
-                sys.exit("Cannot read description file (%s)" %opts.file)
-        else:
-            sys.exit("Must specify an experiment description (--file)")
-
-        if not opts.master:
-            sys.exit("Must specify a master testbed (--master)")
-
         out_certfile = opts.out_certfile
 
-        msg = {
-                'experimentdescription': { 'ns2description': exp_desc },
-                'master': opts.master,
-                'exportProject': { 'localname': opts.project },
-                'user' : [ {\
-                        'userID': pack_id(user), \
-                        'access': [ { a.type: a.buf } for a in access_keys]\
-                        } ]
-                }
+        msg = { }
 
         if opts.exp_name:
@@ -1412,4 +1388,103 @@
             print "status: %s" % st
 
+
+class create(fedd_rpc):
+    def __init__(self): 
+        fedd_rpc.__init__(self, "Create")
+    def __call__(self):
+        access_keys = []
+        # Process the options using the customized option parser defined above
+        parser = fedd_create_opts(access_keys, self.add_ssh_key,
+                self.add_x509_cert)
+
+        (opts, args) = parser.parse_args()
+
+        if opts.trusted:
+            if ( not os.access(opts.trusted, os.R_OK) ) :
+                sys.exit("Cannot read trusted certificates (%s)" % opts.trusted)
+
+        if not opts.project :
+            parser.error('--project is required')
+
+        if opts.debug > 0: opts.tracefile=sys.stderr
+
+        (user, cert) = self.get_user_info(access_keys)
+
+        if opts.user: user = opts.user
+
+        if opts.cert != None: cert = opts.cert
+
+        if cert == None:
+            sys.exit("No certificate given (--cert) or found")
+
+        if os.access(cert, os.R_OK):
+            fid = fedid(file=cert)
+            if opts.use_fedid == True:
+                user = fid
+        else:
+            sys.exit("Cannot read certificate (%s)" % cert)
+
+        if opts.file:
+            exp_desc = ""
+            try:
+                f = open(opts.file, 'r')
+                for line in f:
+                    exp_desc += line
+                f.close()
+            except IOError:
+                sys.exit("Cannot read description file (%s)" %opts.file)
+        else:
+            sys.exit("Must specify an experiment description (--file)")
+
+        if not opts.master:
+            sys.exit("Must specify a master testbed (--master)")
+
+        out_certfile = opts.out_certfile
+
+        msg = {
+                'experimentdescription': { 'ns2description': exp_desc },
+                'master': opts.master,
+                'exportProject': { 'localname': opts.project },
+                'user' : [ {\
+                        'userID': pack_id(user), \
+                        'access': [ { a.type: a.buf } for a in access_keys]\
+                        } ]
+                }
+
+        if opts.exp_name:
+            msg['experimentID'] = { 'localname': opts.exp_name }
+
+        if opts.debug > 1: print >>sys.stderr, msg
+
+        try:
+            resp_dict = self.do_rpc(msg, 
+                    opts.url, opts.transport, cert, opts.trusted, 
+                    serialize_only=opts.serialize_only,
+                    tracefile=opts.tracefile)
+        except self.RPCException, e:
+            exit_with_fault(\
+                    {'desc': e.desc, 'errstr': e.errstr, 'code': e.code})
+        except RuntimeError, e:
+            sys.exit("Error processing RPC: %s" % e)
+
+        if opts.debug > 1: print >>sys.stderr, resp_dict
+
+        ea = resp_dict.get('experimentAccess', None)
+        if out_certfile and ea and ea.has_key('X509'):
+            try:
+                f = open(out_certfile, "w")
+                print >>f, ea['X509']
+                f.close()
+            except IOError:
+                sys.exit('Could not write to %s' %  out_certfile)
+        eid = resp_dict.get('experimentID', None)
+        if eid:
+            for id in eid:
+                for k in id.keys():
+                    print "%s: %s" % (k, id[k])
+        st = resp_dict.get('experimentStatus', None)
+        if st:
+            print "status: %s" % st
+
 class split(fedd_rpc):
     def __init__(self): 
@@ -1749,4 +1824,5 @@
 
 cmds = {\
+        'new': new(),\
         'create': create(),\
         'split': split(),\
