kaname 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93ce158126b82364f8793a40de13258e28b776ad7ee2a8bd35ac6b5f32f4b526
4
- data.tar.gz: d2641332e6d266521f3faad66b6482ad057d04688c7fce8cbb9e463f7bd9de20
3
+ metadata.gz: c9bb34f056e95f72704b84a514305563ca17931d6ca9bc282caef210e7d43ef1
4
+ data.tar.gz: f6b357b16049d9cf528217cc9353430a39b45b44415f92e28fa2819e960dfbc6
5
5
  SHA512:
6
- metadata.gz: e891cc790d96086bb83065651ec61d3763ed13c1156991f5f6c0631c73b8ccdf4c6e1b4f2da2faec8f853aae6c3aa686fec3ee228f52c45f9709f90ac0ccecfd
7
- data.tar.gz: f72fd7ce52e9d195014f2eb654659aa50279404a45371d570e21c0e673b23ac2f10b1409f987a9effe3edf51c6c98d5bdafe1c85062278286f50eadc86d972ae
6
+ metadata.gz: eb512dd45dfb0df7eb0fe7098f1433b111cb007380a0c8f01f40be86368f70eccdd2c1e6cda693f4837ad9274e65427dcffecbef56b8a28669d80976c7eed1ff
7
+ data.tar.gz: 47d99b2ac4cdd68f9fedf87235643ce411038e6d365291d74a37c08c2a22c87acabd40b48eae09cd6709d824dff6d5c5c5457bd812a717c226305a5127b7dd05
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency "yao", ">= 0.3.3"
22
+ spec.add_dependency "yao", ">= 0.8.0"
23
23
  spec.add_dependency "diffy"
24
24
  spec.add_dependency "hashdiff", ">= 1.0.0"
25
25
  spec.add_dependency "thor"
@@ -10,12 +10,16 @@ module Kaname
10
10
  end
11
11
 
12
12
  def find_user(name)
13
- user = Yao::User.find_by_name(name)
13
+ user = Yao::User.find_by_name(name).first
14
14
  {"id" => user.id, "name" => user.name}
15
15
  end
16
16
 
17
17
  def list_tenants
18
- @_tenants ||= Yao::Tenant.list
18
+ @_tenants ||= if keystone_v2?
19
+ Yao::Tenant.list
20
+ else
21
+ Yao::Project.list
22
+ end
19
23
  end
20
24
 
21
25
  def list_roles
@@ -62,6 +66,10 @@ module Kaname
62
66
 
63
67
  private
64
68
 
69
+ def keystone_v2?
70
+ Yao.default_client.pool["identity"].url_prefix.to_s.match(/v2\.0/)
71
+ end
72
+
65
73
  def tenant_role_hash(user_id)
66
74
  list_role_assignments.each_with_object(Hash.new) do |t,th|
67
75
  if t.user.id == user_id
@@ -1,3 +1,3 @@
1
1
  module Kaname
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaname
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SHIBATA Hiroshi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-26 00:00:00.000000000 Z
11
+ date: 2019-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yao
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.3
19
+ version: 0.8.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.3
26
+ version: 0.8.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: diffy
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  - !ruby/object:Gem::Version
198
198
  version: '0'
199
199
  requirements: []
200
- rubygems_version: 3.0.1
200
+ rubygems_version: 3.0.3
201
201
  signing_key:
202
202
  specification_version: 4
203
203
  summary: Identity configuration tool for OpenStack.