From c31420e7db5351b9840f7424c7d4c703067d9332 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Thu, 28 Apr 2011 15:27:56 -0400 Subject: [PATCH] now uses new RSpec libraries --- sfa/client/sfiDeleteSliver.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sfa/client/sfiDeleteSliver.py b/sfa/client/sfiDeleteSliver.py index c8e769aa..d97dfdaf 100755 --- a/sfa/client/sfiDeleteSliver.py +++ b/sfa/client/sfiDeleteSliver.py @@ -1,7 +1,8 @@ #! /usr/bin/env python import sys -from sfa.util.rspecHelper import RSpec, Commands +from sfa.client.sfi_commands import Commands +from sfa.rspecs.rspec_parser import parse_rspec command = Commands(usage="%prog [options] node1 node2...", description="Delete slivers from the RSpec. " + @@ -10,13 +11,20 @@ command = Commands(usage="%prog [options] node1 node2...", command.add_nodefile_option() command.prep() -for node in command.nodes: - try: - command.rspec.remove_sliver(node) - except: - print >> sys.stderr, "FAILED: %s" % node +if command.opts.infile: + rspec = parse_rspec(command.opts.infile) + nodes = [] + if command.opts.nodefile: + f = open(command.opts.nodefile, "r") + nodes = f.read().split() + f.close() + + try: + rspec.remove_slivers(nodes) + except: + print >> sys.stderr, "FAILED: %s" -print command.rspec + print rspec.toxml() -- 2.45.2