From d37a5fc0cec9499ef9582eec8738fc3635cf9fbb Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Fri, 11 Nov 2011 00:10:05 -0500 Subject: [PATCH] nodes are Node objects --- sfa/client/sfiListNodes.py | 4 +--- sfa/client/sfiListSlivers.py | 15 ++++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sfa/client/sfiListNodes.py b/sfa/client/sfiListNodes.py index 29fc80d0..3de1657f 100755 --- a/sfa/client/sfiListNodes.py +++ b/sfa/client/sfiListNodes.py @@ -19,9 +19,7 @@ if command.opts.infile: for node in nodes: hostname = None - if node.get('component_name'): - hostname = node['component_name'] - elif node.get('component_id'): + if node.get('component_id'): hostname = xrn_to_hostname(node['component_id']) if hostname: print hostname diff --git a/sfa/client/sfiListSlivers.py b/sfa/client/sfiListSlivers.py index cf76823f..c869f614 100755 --- a/sfa/client/sfiListSlivers.py +++ b/sfa/client/sfiListSlivers.py @@ -3,6 +3,7 @@ import sys from sfa.client.sfi_commands import Commands from sfa.rspecs.rspec import RSpec +from sfa.util.plxrn import xrn_to_hostname command = Commands(usage="%prog [options]", description="List all slivers in the RSpec. " + @@ -23,10 +24,14 @@ if command.opts.infile: print " %s: %s" % (name, value) for node in nodes: - print node - if command.opts.showatt: - atts = rspec.version.get_sliver_attributes(node) - for (name, value) in atts: - print " %s: %s" % (name, value) + hostname = None + if node.get('component_id'): + hostname = xrn_to_hostname(node['component_id']) + if hostname: + print hostname + if command.opts.showatt: + atts = rspec.version.get_sliver_attributes(hostname) + for (name, value) in atts: + print " %s: %s" % (name, value) -- 2.47.0