78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/dcmgr/cli/image.rb', line 78
def show(uuid=nil)
if uuid
img = M::Image[uuid]
print ERB.new(<<__END, nil, '-').result(binding)
UUID:
<%= img.canonical_uuid %>
Boot Type:
<%= img.boot_dev_type %>
Arch:
<%= img.arch %>
<%- if img.description -%>
Description:
<%= img.description %>
<%- end -%>
Is Public:
<%= img.is_public %>
State:
<%= img.state %>
__END
else
cond = {}
imgs = M::Image.filter(cond).all
print ERB.new(<<__END, nil, '-').result(binding)
<%- imgs.each { |row| -%>
<%= "%-20s %-15s %-15s" % [row.canonical_uuid, row.boot_dev_type, row.arch] %>
<%- } -%>
__END
end
end
|