deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronelle Landy <rla...@redhat.com>
Subject Re: [PATCH core 2/2] Client: Explicitly convert the name and id in Instance formatter to String (DTACLOUD-27)
Date Thu, 26 Apr 2012 17:07:58 GMT
ACK 
...test results with patch changes are below:

>> /home/dcloud/workspace/deltacloud/client/bin/deltacloudc instances -u http://<srver>:3008/api
-U <un> -P <pw>
d1a504bd-4b93-4 | 335462848.0     | 01389f7e-ef5b-4 |    STOPPED |      00:1a:4a:10:78:2d,127.0.0.1
|                                 
6c05290a-97a7-4 | App-ConfigSrv-0 | f60974b1-89cf-4 |    RUNNING |                    10.16.120.180
|                                 
2208e62e-dee9-4 | App-ConfigSrv-8 | 4d556147-4be5-4 |    STOPPED | 00:1a:4a:10:78:f6,qeblade27.rhq.
|                                 
5c1b77ce-89dc-4 | App-ConfigSrv-u | c77d5d71-f84e-4 |    RUNNING |                    10.16.120.229
|                                 
.............

Top instance has a numeric name.

----- Original Message -----
> From: mfojtik@redhat.com
> To: dev@deltacloud.apache.org
> Sent: Thursday, April 26, 2012 10:27:02 AM
> Subject: [PATCH core 2/2] Client: Explicitly convert the name and id in Instance formatter
to String (DTACLOUD-27)
> 
> From: Michal Fojtik <mfojtik@redhat.com>
> 
> 
> Signed-off-by: Michal fojtik <mfojtik@redhat.com>
> ---
>  client/lib/plain_formatter.rb |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/client/lib/plain_formatter.rb
> b/client/lib/plain_formatter.rb
> index a8a501e..2e2ada3 100644
> --- a/client/lib/plain_formatter.rb
> +++ b/client/lib/plain_formatter.rb
> @@ -68,9 +68,9 @@ module DeltaCloud
>        class Instance < Base
>          def format
>            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.id ? @obj.id.to_s[0,15] : '-',
> +            @obj.name ? @obj.name.to_s[0,15] : 'unknown',
> +            @obj.image.name ? @obj.image.name.to_s[0,15] :
> 'unknown',
>              @obj.state ? @obj.state.to_s[0,10] : 'unknown',
>              @obj.public_addresses.collect { |a| a[:address]
>              }.join(',')[0,32],
>              @obj.private_addresses.collect { |a| a[:address]
>              }.join(',')[0,32]
> --
> 1.7.10
> 
> 

Mime
View raw message