Class: Opc::OpcOrgList

Inherits:
Chef::Knife
  • Object
show all
Includes:
Chef::Mixin::RootRestv0
Defined in:
lib/chef/knife/opc_org_list.rb

Instance Method Summary collapse

Methods included from Chef::Mixin::RootRestv0

#root_rest

Instance Method Details

#runObject



37
38
39
40
41
42
43
# File 'lib/chef/knife/opc_org_list.rb', line 37

def run
  results = root_rest.get("organizations")
  unless config[:all_orgs]
    results = results.select { |k, v| !(k.length == 20 && k =~ /^[a-z]+$/) }
  end
  ui.output(ui.format_list_for_display(results))
end