From 16515b832efae02be62109f780e1008ce9994fc6 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Thu, 10 Nov 2011 23:55:55 -0500 Subject: [PATCH] nodes are Node objects --- sfa/client/sfiListNodes.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sfa/client/sfiListNodes.py b/sfa/client/sfiListNodes.py index f9e794b8..29fc80d0 100755 --- a/sfa/client/sfiListNodes.py +++ b/sfa/client/sfiListNodes.py @@ -2,7 +2,8 @@ import sys from sfa.client.sfi_commands import Commands -from sfa.rspecs.rspec import RSpec +from sfa.rspecs.rspec import RSpec +from sfa.util.plxrn import xrn_to_hostname command = Commands(usage="%prog [options]", description="List all nodes in the RSpec. " + @@ -17,7 +18,13 @@ if command.opts.infile: sys.stdout = open(command.opts.outfile, 'w') for node in nodes: - print node + hostname = None + if node.get('component_name'): + hostname = node['component_name'] + elif node.get('component_id'): + hostname = xrn_to_hostname(node['component_id']) + if hostname: + print hostname -- 2.47.0