lib/plain_formatter.rb in deltacloud-client-0.3.1 vs lib/plain_formatter.rb in deltacloud-client-0.4.0

- old
+ new

@@ -1,7 +1,5 @@ -# Copyright (C) 2009, 2010 Red Hat, Inc. -# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The # ASF licenses this file to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance with the @@ -63,12 +61,12 @@ sprintf("%-15s | %-15s | %-15s | %10s | %32s | %32s", @obj.id ? @obj.id[0,15] : '-', @obj.name ? @obj.name[0,15] : 'unknown', @obj.image.name ? @obj.image.name[0,15] : 'unknown', @obj.state ? @obj.state.to_s[0,10] : 'unknown', - @obj.public_addresses.join(',')[0,32], - @obj.private_addresses.join(',')[0,32] + @obj.public_addresses.collect { |a| a[:address] }.join(',')[0,32], + @obj.private_addresses.collect { |a| a[:address] }.join(',')[0,32] ) end end class StorageVolume < Base @@ -98,10 +96,10 @@ def format sprintf("%-s | %-s | %-s | %-s", @obj.id, @obj.name, @obj.size ? @obj.size : "0", - @obj.blob_list ? @obj.blob_list : "" + @obj.instance_variables.include?("@blob_list") ? @obj.blob_list : "" ) end end class Blob < Base