lmcadm 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb9400a2047405a5ece2875ee8d660751d129638
4
- data.tar.gz: 82872042e8f5a455fa90ce11a9f65c73e30522b0
3
+ metadata.gz: a990a6d39e05d589b58671231dfc4f2464dba593
4
+ data.tar.gz: d1846b40cd26efd2b231e6d086d8ae4d50073ea2
5
5
  SHA512:
6
- metadata.gz: 80cdb181a6456fff7aeb41cb3ae7e07277d1deffe80e09d028d546235a06c526e469d2fe439af253e8b9a65ce4671ee019846efbaff8a4fa6e507de15a96f86a
7
- data.tar.gz: 8213f89d1ac1dab04d2ce94479c978e6a88a1e28e39b8bcf758baa5443686088ba3bac0e3b7f8efee167228c47ef1b7fdd0a7cc9dbb5b95d7382f701a9ebb7c7
6
+ metadata.gz: e70f755c9fc4cde186e8a822fbcad76120e195a35771235af04ac37a310d1c458cadc39f1bf7fd6a7c2f576022784553607c6803a1531aabad4f77327f5db596
7
+ data.tar.gz: b779db3ee64def14c157619917248a39f62ad778851c1dd209906882a0091e87a63d59ef03f7ae1b7baa97a466bc09bb11d8417db49b540a8996006c2c208b7c
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" addBOMForNewFiles="with NO BOM" />
4
+ </project>
data/README.md CHANGED
@@ -20,8 +20,6 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
20
20
 
21
21
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
22
22
 
23
- ### Branching
24
- To avoid immediate chaos, a branching model of "create a branch for new versions aka v0.6.1" has been adpoted until further notice.
25
23
  ### Using a local version of the lmc gem
26
24
 
27
25
  Set the environment variable LMCADM\_PATH\_DEP to 1 to use the _lmc_ gem from ../ruby-lmc.
@@ -82,9 +82,9 @@ module LMCAdm
82
82
  account_create.action do |global_options, options, args|
83
83
  parent = LMC::Account.get_by_uuid_or_name options[:p]
84
84
  t = ProgressVisualizer.new "Creating object"
85
- a = LMC::Account.new({"name" => args.first,
86
- "type" => options[GLI::Command::PARENT][:account_type],
87
- "parent" => parent.id})
85
+ a = LMC::Account.new({ "name" => args.first,
86
+ "type" => options[GLI::Command::PARENT][:account_type],
87
+ "parent" => parent.id })
88
88
  t.done
89
89
  t = ProgressVisualizer.new "Saving #{a.name}"
90
90
  result = a.save
@@ -117,7 +117,7 @@ module LMCAdm
117
117
  exit unless STDIN.gets.chomp == 'yes'
118
118
  t = ProgressVisualizer.new "Deleting accounts"
119
119
  matched_accounts.each do |a|
120
- a.delete
120
+ a.delete!
121
121
  t.dot
122
122
  end
123
123
  t.done
@@ -159,12 +159,12 @@ module LMCAdm
159
159
  memberlist.action do |global_options, options, args|
160
160
  account = LMC::Account.get_by_uuid_or_name args.first
161
161
  members = account.members
162
- tp members, [{:id => {:width => 36}}, :name, :type, :state, :invitationState, :principalState,
163
- :authorities => lambda {|m|
162
+ tp members, [{ :id => { :width => 36 } }, :name, :type, :state, :invitationState, :principalState,
163
+ :authorities => { :display_method => lambda {|m|
164
164
  m.authorities.map {|a|
165
165
  a['name']
166
166
  }.join(',')
167
- }]
167
+ }, :width => 128 }]
168
168
  end
169
169
  end
170
170
 
@@ -276,7 +276,7 @@ module LMCAdm
276
276
  account = LMC::Account.get_by_uuid_or_name args.first
277
277
  authorities = account.authorities
278
278
  max = Helpers::longest_in_collection(authorities.map {|a| a.name})
279
- tp authorities, [{:id => {:width => 36}}, {:name => {:width => max}}, :visibility, :type]
279
+ tp authorities, [{ :id => { :width => 36 } }, { :name => { :width => max } }, :visibility, :type]
280
280
  end
281
281
  end
282
282
  c.desc 'Manage authorities'
@@ -287,7 +287,7 @@ module LMCAdm
287
287
  create.flag :A, :required => true
288
288
  create.action do |_global_options, options, _args|
289
289
  account = LMC::Account.get_by_uuid_or_name options[:A]
290
- auth = LMC::Authority.new({'name' => _args.first, 'visibility' => 'PRIVATE'}, account)
290
+ auth = LMC::Authority.new({ 'name' => _args.first, 'visibility' => 'PRIVATE' }, account)
291
291
  puts auth.save
292
292
  end
293
293
  end
@@ -376,7 +376,7 @@ module LMCAdm
376
376
  # POST /accounts/{accountId}/members/{principalId}
377
377
  cloud = LMC::Cloud.instance
378
378
  cloud.auth_for_account account
379
- res = cloud.post ['cloud-service-auth', 'accounts', account.id, 'members', membership.id], {'authorities' => authority_ids}
379
+ res = cloud.post ['cloud-service-auth', 'accounts', account.id, 'members', membership.id], { 'authorities' => authority_ids }
380
380
  puts res
381
381
  end
382
382
  end
@@ -21,9 +21,9 @@ module LMCAdm
21
21
  #account = cloud.get_account(nil, 'ROOT')
22
22
  #puts account.inspect
23
23
  #cloud.auth_for_accounts([account.id])
24
- backstage_infos = cloud.get_backstage_serviceinfos.body.map {|info| {'serviceId' => info.serviceId,
25
- 'instanceCount' => info.instanceCount,
26
- 'versions' => info.versionInfoList.map {|vil| vil['version']}.uniq.join(",")
24
+ backstage_infos = cloud.get_backstage_serviceinfos.body.map {|info| { 'serviceId' => info.serviceId,
25
+ 'instanceCount' => info.instanceCount,
26
+ 'versions' => info.versionInfoList.map {|vil| vil['version']}.uniq.join(",")
27
27
  }}
28
28
  tp backstage_infos
29
29
  puts '---'
@@ -50,12 +50,12 @@ module LMCAdm
50
50
  begin
51
51
  cloud = LMC::Cloud.instance
52
52
  rescue LMC::OutdatedTermsOfUseException => e
53
- matched_tos = e.missing.select do |missingtos|
54
- args.include? missingtos['name']
55
- end
56
- cloud = LMC::Cloud.instance authorize: false
57
- puts "Accepting TOS #{matched_tos.to_s}"
58
- cloud.accept_tos matched_tos
53
+ matched_tos = e.missing.select do |missingtos|
54
+ args.include? missingtos['name']
55
+ end
56
+ cloud = LMC::Cloud.instance authorize: false
57
+ puts "Accepting TOS #{matched_tos.to_s}"
58
+ cloud.accept_tos matched_tos
59
59
  end
60
60
  end
61
61
  end
@@ -75,5 +75,19 @@ module LMCAdm
75
75
  user.update(global_options[:password])
76
76
  end
77
77
  end
78
+
79
+ c.arg_name 'account'#, :multiple => true # no support for multiple accounts until the auth_for_accounts api is fixed
80
+ c.desc 'Request auth token'
81
+ c.command :token do |get_token|
82
+ get_token.action do |_g, _o, args|
83
+ accounts = args.map { |a|
84
+ LMC::Account.get_by_uuid_or_name a
85
+ }
86
+ accounts.each { |a|
87
+ a.cloud.auth_for_account a
88
+ puts a.cloud.session_token
89
+ }
90
+ end
91
+ end
92
+ end
78
93
  end
79
- end
@@ -1,3 +1,3 @@
1
1
  module LMCAdm
2
- VERSION = '0.9.1'
2
+ VERSION = '0.9.2'
3
3
  end
data/lmcadm.gemspec CHANGED
@@ -12,14 +12,6 @@ Gem::Specification.new do |spec|
12
12
  spec.summary = %q{lmcadm is a command line client for LMC}
13
13
  spec.license = "BSD-3-Clause"
14
14
 
15
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
16
- # to allow pushing to a single host or delete this section to allow pushing to any host.
17
- if spec.respond_to?(:metadata)
18
- else
19
- raise "RubyGems 2.0 or newer is required to protect against " \
20
- "public gem pushes."
21
- end
22
-
23
15
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
24
16
  f.match(%r{^(test|spec|features)/})
25
17
  end
@@ -27,7 +19,7 @@ Gem::Specification.new do |spec|
27
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
20
  spec.require_paths = ["lib"]
29
21
 
30
- spec.add_development_dependency "bundler", "~> 1.16"
22
+ spec.add_development_dependency "bundler", "~> 2.0"
31
23
  spec.add_development_dependency "rake", "~> 10.0"
32
24
  spec.add_development_dependency "minitest", "~> 5.0"
33
25
  spec.add_development_dependency "pry-nav", "0.2.4"
@@ -35,5 +27,5 @@ Gem::Specification.new do |spec|
35
27
  spec.add_runtime_dependency 'lmc', '~> 0.8.0'
36
28
  spec.add_runtime_dependency 'gli', '~> 2.17'
37
29
  spec.add_runtime_dependency 'table_print', '~> 1.5'
38
- spec.add_runtime_dependency 'colorize'
30
+ spec.add_runtime_dependency 'colorize', '~> 0.8'
39
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lmcadm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - erpel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-25 00:00:00.000000000 Z
11
+ date: 2019-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '2.0'
20
20
  type: :development
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: '1.16'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: colorize
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: '0.8'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: '0.8'
125
125
  description:
126
126
  email:
127
127
  - philipp@copythat.de
@@ -131,9 +131,9 @@ extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
133
  - ".gitignore"
134
+ - ".idea/encodings.xml"
134
135
  - ".idea/vcs.xml"
135
136
  - ".ruby-version"
136
- - ".travis.yml"
137
137
  - Gemfile
138
138
  - LICENSE.txt
139
139
  - README.md
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.16.1