You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/04/26 16:27:01 UTC

[PATCH core 1/2] Client: Added formatter for Key collection (DTACLOUD-199)

From: Michal Fojtik <mf...@redhat.com>


Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 client/lib/plain_formatter.rb |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/client/lib/plain_formatter.rb b/client/lib/plain_formatter.rb
index 8854d68..a8a501e 100644
--- a/client/lib/plain_formatter.rb
+++ b/client/lib/plain_formatter.rb
@@ -23,6 +23,15 @@ module DeltaCloud
         end
       end
 
+      class Key < Base
+        def format
+          sprintf("%-10s | %-60s",
+              @obj.id[0,10],
+              @obj.fingerprint
+          )
+        end
+      end
+
       class Image < Base
         def format
           sprintf("%-10s | %-20s | %-6s | %-20s | %15s",
-- 
1.7.10


Re: [PATCH core 2/2] Client: Explicitly convert the name and id in Instance formatter to String (DTACLOUD-27)

Posted by Ronelle Landy <rl...@redhat.com>.
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 <mf...@redhat.com>
> 
> 
> Signed-off-by: Michal fojtik <mf...@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
> 
> 

[PATCH core 2/2] Client: Explicitly convert the name and id in Instance formatter to String (DTACLOUD-27)

Posted by mf...@redhat.com.
From: Michal Fojtik <mf...@redhat.com>


Signed-off-by: Michal fojtik <mf...@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