Sha256: 0d8e2c55571cb3f434fb68f30c83b2e88ff4d15925a410118d88e68282ff0e81
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
require 'yaml' module Kaname class Resource class << self def yaml(filename = 'keystone.yml') @_yaml = if File.exists?(filename) YAML.load_file(filename) else nil end end def users @_users ||= Yao::User.list end def tenants @_tenants ||= Yao::Tenant.list end def roles @_roles ||= Yao::Role.list end def users_hash return @h if @h @h = {} users.each do |u| next if ignored_users.include?(u.name) @h[u.name] = {} @h[u.name]["email"] = u.email @h[u.name]["tenants"] = {} tenants.each do |t| r = Yao::Role.list_for_user(u.name, on: t.name) if r.size > 0 @h[u.name]["tenants"][t.name] = r.first.name end end end @h end # default service users def ignored_users %w[ neutron glance cinder admin nova_ec2 nova heat ceilometer ] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kaname-0.4.0 | lib/kaname/resource.rb |