ListResources now supports slice lookups
authorJosh Karlin <jkarlin@bbn.com>
Thu, 25 Mar 2010 19:49:14 +0000 (19:49 +0000)
committerJosh Karlin <jkarlin@bbn.com>
Thu, 25 Mar 2010 19:49:14 +0000 (19:49 +0000)
sfa/client/sfi.py
sfa/managers/geni_am_pl.py
sfa/trust/gid.py

index c6b0a61..92fe1ff 100755 (executable)
@@ -912,6 +912,13 @@ class Sfi:
         user_cred = self.get_user_cred().save_to_string(save_parents=True)
         server = self.geni_am
         call_options = {'geni_compressed': True}
+        if args:
+            urn = args[0]
+        else:
+            urn = None
+        if urn:
+            call_options['geni_slice_urn'] = urn
+            
         rspec = server.ListResources([user_cred], call_options)
         rspec = zlib.decompress(rspec.decode('base64'))
         print rspec
index afa747a..f144430 100644 (file)
@@ -33,11 +33,13 @@ def ListResources(api, creds, options):
     manager_module = manager_base + ".aggregate_manager_%s" % mgr_type
     manager = __import__(manager_module, fromlist=[manager_base])
 
-    urn = None
+    hrn = None
     if options.has_key('geni_slice_urn'):
-        urn = options['geni_slice_urn']
+        xrn = options['geni_slice_urn']
+        hrn, type = urn_to_hrn(xrn)
 
-    rspec = manager.get_rspec(api, urn, None)
+
+    rspec = manager.get_rspec(api, hrn, None)
     #outgoing_rules = SFATablesRules('OUTGOING')
     
     if options.has_key('geni_compressed') and options['geni_compressed'] == True:
index 5c7b735..d62e43e 100644 (file)
@@ -8,7 +8,6 @@
 
 import xmlrpclib
 import uuid
-
 from sfa.trust.certificate import Certificate
 from sfa.util.namespace import *
 ##
@@ -59,7 +58,7 @@ class GID(Certificate):
         
         Certificate.__init__(self, create, subject, string, filename)
         if uuid:
-            self.uuid = uuid
+            self.uuid = int(uuid)
         if hrn:
             self.hrn = hrn
         if urn: