git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
76ec829
)
now uses new RSpec libraries
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 28 Apr 2011 19:27:56 +0000
(15:27 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 28 Apr 2011 19:27:56 +0000
(15:27 -0400)
sfa/client/sfiDeleteSliver.py
patch
|
blob
|
history
diff --git
a/sfa/client/sfiDeleteSliver.py
b/sfa/client/sfiDeleteSliver.py
index
c8e769a
..
d97dfda
100755
(executable)
--- a/
sfa/client/sfiDeleteSliver.py
+++ b/
sfa/client/sfiDeleteSliver.py
@@
-1,7
+1,8
@@
#! /usr/bin/env python
import sys
#! /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. " +
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()
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()