Added Location column in image list display

This commit is contained in:
siddheshwar-more 2013-09-04 17:42:48 +05:30 коммит произвёл adamedx
Родитель 8122ffbbc3
Коммит 6753d1d641
3 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -51,12 +51,13 @@ end
class Azure class Azure
class Image class Image
attr_accessor :category, :label attr_accessor :category, :label
attr_accessor :name, :os, :eula, :description attr_accessor :name, :os, :eula, :description, :location
def initialize(image) def initialize(image)
@category = image.at_css('Category').content @category = image.at_css('Category').content
@label = image.at_css('Label').content @label = image.at_css('Label').content
@name = image.at_css('Name').content @name = image.at_css('Name').content
@os = image.at_css('OS').content @os = image.at_css('OS').content
@location = image.at_css('Location').content.gsub(";", ", ")
@eula = image.at_css('Eula').content if image.at_css('Eula') @eula = image.at_css('Eula').content if image.at_css('Eula')
@description = image.at_css('Description').content if image.at_css('Description') @description = image.at_css('Description').content if image.at_css('Description')
end end

Просмотреть файл

@ -72,7 +72,7 @@ module AzureAPI
elsif verb == 'delete' elsif verb == 'delete'
request = Net::HTTP::Delete.new(uri.request_uri) request = Net::HTTP::Delete.new(uri.request_uri)
end end
request["x-ms-version"] = "2012-03-01" request["x-ms-version"] = "2013-03-01"
request["content-type"] = "application/xml" request["content-type"] = "application/xml"
request["accept"] = "application/xml" request["accept"] = "application/xml"
request["accept-charset"] = "utf-8" request["accept-charset"] = "utf-8"

Просмотреть файл

@ -44,7 +44,7 @@ class Chef
validate! validate!
image_labels = !locate_config_value(:show_all_fields) ? ['Name', 'OS'] : ['Name', 'Category', 'Label', 'OS'] image_labels = !locate_config_value(:show_all_fields) ? ['Name', 'OS', 'Location'] : ['Name', 'Category', 'Label', 'OS', 'Location']
image_list = image_labels.map {|label| ui.color(label, :bold)} image_list = image_labels.map {|label| ui.color(label, :bold)}
items = connection.images.all items = connection.images.all
@ -54,7 +54,7 @@ class Chef
end end
puts "\n" puts "\n"
puts h.list(image_list, :uneven_columns_across, !locate_config_value(:show_all_fields) ? 2 : 4) puts h.list(image_list, :uneven_columns_across, !locate_config_value(:show_all_fields) ? 3 : 5)
end end
end end