Skip to content

Commit

Permalink
F OpenNebula#3378: add new column to show fed index
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Huertas committed Jun 10, 2019
1 parent 079d5d7 commit 3ac5cc8
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/cli/one_helper/onezone_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,29 @@ def format_pool(options)
d["TEMPLATE"]['ENDPOINT']
end

default :CURRENT, :ID, :NAME, :ENDPOINT
column :FED_INDEX, "Federation index", :left, :size=>10 do |d|
helper.get_fed_index(d['ID'])
end

default :CURRENT, :ID, :NAME, :ENDPOINT, :FED_INDEX
end

table
end

def get_fed_index(zone_id)
zone = factory(zone_id)

zone.info_extended
zone = zone.to_hash

if !zone['ZONE']['SERVER_POOL'].empty?
zone['ZONE']['SERVER_POOL']['SERVER']['FEDLOG_INDEX']
else
'-'
end
end

def set_zone(zone_id, temporary_zone)
zone = factory(zone_id)
rc = zone.info
Expand Down

0 comments on commit 3ac5cc8

Please sign in to comment.