From 23928a454c6bda349d7a2d14b8c57b5f39406124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 6 Jul 2011 15:58:48 +0200 Subject: [PATCH] Feature #687: remove trailing spaces in oneacl_helper.rb --- src/cli/one_helper/oneacl_helper.rb | 66 ++++++++++++++--------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/cli/one_helper/oneacl_helper.rb b/src/cli/one_helper/oneacl_helper.rb index 9b6bb7303e..bb5968d948 100644 --- a/src/cli/one_helper/oneacl_helper.rb +++ b/src/cli/one_helper/oneacl_helper.rb @@ -43,57 +43,57 @@ private # TODO check that @content[:resources_str] is valid def self.resource_mask(str) resource_type=str.split("/")[0] - + mask = "-------" - + resource_type.split("+").each{|type| case type when "VM" - mask[0] = "V" + mask[0] = "V" when "HOST" - mask[1] = "H" + mask[1] = "H" when "NET" - mask[2] = "N" + mask[2] = "N" when "IMAGE" - mask[3] = "I" + mask[3] = "I" when "USER" mask[4] = "U" when "TEMPLATE" mask[5] = "T" when "GROUP" - mask[6] = "G" - end - } + mask[6] = "G" + end + } mask end - + # TODO check that @content[:resources_str] is valid def self.right_mask(str) - mask = "---------" - + mask = "---------" + str.split("+").each{|type| case type when "CREATE" - mask[0] = "C" + mask[0] = "C" when "DELETE" - mask[1] = "D" + mask[1] = "D" when "USE" - mask[2] = "U" + mask[2] = "U" when "MANAGE" - mask[3] = "M" + mask[3] = "M" when "INFO" mask[4] = "I" when "INFO_POOL" mask[5] = "P" when "INFO_POOL_MINE" - mask[6] = "p" + mask[6] = "p" when "INSTANTIATE" - mask[8] = "T" + mask[8] = "T" when "CHOWN" - mask[9] = "W" - end + mask[9] = "W" + end } - + mask end @@ -101,33 +101,33 @@ private config_file=self.class.table_conf table=CLIHelper::ShowTable.new(config_file, self) do - column :ID, "Rule Identifier", - :size=>5 do |d| + column :ID, "Rule Identifier", + :size=>5 do |d| d['ID'] end - - column :USER, "To which resource owner the rule applies to", - :size=>8 do |d| + + column :USER, "To which resource owner the rule applies to", + :size=>8 do |d| d['STRING'].split(" ")[0] end - + column :RES_VHNIUTG, "Resource to which the rule applies" do |d| - OneAclHelper::resource_mask d['STRING'].split(" ")[1] + OneAclHelper::resource_mask d['STRING'].split(" ")[1] end - + column :RID, "Resource ID", :right, :size=>8 do |d| d['STRING'].split(" ")[1].split("/")[1] end - + column :OPE_CDUMIPpTW, "Operation to which the rule applies" do |d| - OneAclHelper::right_mask d['STRING'].split(" ")[2] + OneAclHelper::right_mask d['STRING'].split(" ")[2] end default :ID, :USER, :RES_VHNIUTG, :RID, :OPE_CDUMIPpTW end table.show(pool, options) - + end - + end \ No newline at end of file