renamed sfaticket from util/ to trust/
[sfa.git] / sfa / client / sfiDeleteSliver.py
index 67cd9d3..be10f0b 100755 (executable)
@@ -2,7 +2,7 @@
 
 import sys
 from sfa.client.sfi_commands import Commands
-from sfa.rspecs.rspec_parser import parse_rspec
+from sfa.rspecs.rspec import RSpec
 
 command = Commands(usage="%prog [options] node1 node2...",
                    description="Delete slivers from the RSpec. " +
@@ -12,7 +12,7 @@ command.add_nodefile_option()
 command.prep()
 
 if command.opts.infile:
-    rspec = parse_rspec(command.opts.infile)
+    rspec = RSpec(command.opts.infile)
     nodes = []
     if command.opts.nodefile:
         f = open(command.opts.nodefile, "r")
@@ -20,11 +20,12 @@ if command.opts.infile:
         f.close()
        
     try:
-        rspec.remove_slivers(nodes)
+        slivers = [{'hostname': node} for node in nodes]
+        rspec.version.remove_slivers(slivers)
+        print rspec.toxml()
     except:
-        print >> sys.stderr, "FAILED: %s"  
+        print >> sys.stderr, "FAILED: %s" % nodes 
 
-    print rspec.toxml()