lmcadm 0.7.2 → 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
  SHA1:
3
- metadata.gz: '096800eeb6d227bf663639f5a9a28f6d56f89a51'
4
- data.tar.gz: 609066249c0a193750e7f2a8641cd0a6709634e0
3
+ metadata.gz: 8a7485cdbf69d7fc0dea05836d5b067b4990ecfe
4
+ data.tar.gz: c5a665e0da9ccd87579c3fb8e52a3bc5c50197a9
5
5
  SHA512:
6
- metadata.gz: 9eadfc9c35be882b2241d1c9ef8e0b93c59ab3bac430b5fba0b5cbcbd03de82118161d8ad03bb915333a3f9e1604e64024c65ab36b8fcecec1c5bbee342486e9
7
- data.tar.gz: 30b0f1ad0672a0bc39eb3b6a1265affb9348d4da6453c3d4d15b7ef4846aa1739655e4f7f332f5c40249f86436a51a5c20dbb2d1ad4d6356164a889d1eb027be
6
+ metadata.gz: 6c92ef18de16e5827614326733c1b74d872e5ab248b214102f30214af06bd4d7678bd58e3633533f1d755a9fca96564944f861417bfb74a8210c825e0870305a
7
+ data.tar.gz: d33ac564bbd30956bcbd7f8b8373c0970a764a1b745347ef32fd18bcb1c85c6e6f90f4c454af9cbcbb586d452d0cd6cca917456e39dbd90a4efd6354126ecaca
data/.gitignore CHANGED
@@ -9,6 +9,9 @@
9
9
  /tmp/
10
10
  /.idea/workspace.xml
11
11
  /.idea/tasks.xml
12
+ /.idea/misc.xml
12
13
  /.idea/.rakeTasks
14
+ /.idea/ruby-lmcadm.iml
15
+ /.idea/modules.xml
13
16
  /Gemfile.lock
14
17
  /lmcadm-*.gem
data/README.md CHANGED
@@ -1,28 +1,18 @@
1
- # Lmcadm
1
+ # lmcadm
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lmcadm`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ The lmcadm command line utility strives to provide an admin and script friendly interface to select LMC functionality.
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'lmcadm'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
7
+ Install via rubygems:
20
8
 
21
9
  $ gem install lmcadm
22
10
 
23
11
  ## Usage
24
12
 
25
- TODO: Write usage instructions here
13
+ The primary usage documentation is in the help output of lmcadm:
14
+
15
+ $ lmcadm help
26
16
 
27
17
  ## Development
28
18
 
@@ -45,4 +35,4 @@ The sentence above is patently wrong currently.
45
35
 
46
36
  ## License
47
37
 
48
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
38
+ The gem is available as open source under the terms of the BSD 3-Clause License.
data/exe/lmcadm CHANGED
@@ -61,8 +61,7 @@ module LMCAdm
61
61
  # Use skips_pre before a command to skip this block
62
62
  # on that command only
63
63
  if global[:password] == ""
64
- puts "Enter password for " + global[:user] + ":"
65
- global[:password] = Helpers::read_pw
64
+ global[:password] = Helpers::read_pw "Enter password for #{global[:user]}:"
66
65
  end
67
66
  ::LMC::Cloud.cloud_host = global[:cloud_host]
68
67
  ::LMC::Cloud.user = global[:user]
@@ -268,7 +268,7 @@ module LMCAdm
268
268
  end
269
269
  end
270
270
  =end
271
- c.arg_name "Account name|UUID", [:required]
271
+ c.arg_name '"Account name"|UUID', [:required]
272
272
  c.desc 'List authorities'
273
273
  c.command :authorities do |auth|
274
274
 
@@ -283,7 +283,7 @@ module LMCAdm
283
283
  c.command :authority do |auth|
284
284
  auth.arg_name 'Authority name', [:required]
285
285
  auth.command :create do |create|
286
- create.desc 'Account name|UUID'
286
+ create.desc '"Account name"|UUID'
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]
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module LMCAdm #:nodoc:
4
+ desc 'Output shell commands to enable completion in bash'
5
+ arg_name :shell
6
+ command :completion do |completion|
7
+ completion.action do |_o, _g, args|
8
+ raise 'only bash supported at the moment' unless
9
+ [nil, 'bash'].include? args.first
10
+ puts <<~'BASH'
11
+ #source this into your bash (via ~/.bashrc or other means)
12
+ complete -F _lmcadm_completions lmcadm
13
+ function _lmcadm_completions()
14
+ {
15
+ COMPREPLY=(`lmcadm help -c "${COMP_WORDS[@]:1}"`)
16
+ }
17
+ BASH
18
+ end
19
+ end
20
+ end
@@ -8,7 +8,7 @@ module LMCAdm
8
8
  root_account = LMC::Account.get LMC::Account::ROOT_ACCOUNT_UUID
9
9
  cloud = LMC::Cloud.instance
10
10
  cloud.auth_for_account root_account
11
- pw = Helpers::read_pw "Enter password for #{args.first}"
11
+ pw = Helpers::read_pw "Enter new password for #{args.first}:"
12
12
  principal = LMC::Principal.new({ 'name' => args.first, 'password' => pw, 'type' => options[:type] })
13
13
  puts principal.save.inspect
14
14
  begin
@@ -1,6 +1,6 @@
1
1
  module LMCAdm
2
2
  command :privatecloud do |pc|
3
- pc.arg_name 'Redirect URL'
3
+ pc.arg_name '"Redirect URL"'
4
4
  pc.desc 'Set redirect URL for account'
5
5
  pc.command :url do |url|
6
6
  url.flag :A, :account
@@ -11,7 +11,7 @@ module LMCAdm
11
11
  end
12
12
  end
13
13
 
14
- pc.arg_name 'Account name|UUID'
14
+ pc.arg_name '"Account name"|UUID'
15
15
  pc.desc 'Show privatecloud account infos'
16
16
  pc.command :show do |show|
17
17
  show.action do |global_options, options, args|
@@ -1,10 +1,15 @@
1
1
  require 'io/console'
2
+ # frozen_string_literal: true
2
3
 
3
4
  module LMCAdm
4
- module Helpers
5
- def self.read_pw(promptstring=nil)
6
- puts promptstring unless promptstring.nil?
7
- STDIN.noecho(&:gets).strip
8
- end
5
+ # This module includes helpers for shared functionality across the
6
+ # application.
7
+ module Helpers
8
+ def self.read_pw(promptstring = '')
9
+ print promptstring
10
+ pw = STDIN.noecho(&:gets).strip
11
+ print "\n"
12
+ pw
9
13
  end
14
+ end
10
15
  end
@@ -1,3 +1,3 @@
1
1
  module LMCAdm
2
- VERSION = "0.7.2"
2
+ VERSION = "0.8.0"
3
3
  end
data/lmcadm.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency "minitest", "~> 5.0"
33
33
  spec.add_development_dependency "pry-nav", "0.2.4"
34
34
 
35
- spec.add_runtime_dependency 'lmc', '~> 0.6.1'
35
+ spec.add_runtime_dependency 'lmc', '~> 0.6.2'
36
36
  spec.add_runtime_dependency 'gli', '~> 2.17'
37
37
  spec.add_runtime_dependency 'table_print', '~> 1.5'
38
38
  spec.add_runtime_dependency 'colorize'
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.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - erpel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-01 00:00:00.000000000 Z
11
+ date: 2018-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.6.1
75
+ version: 0.6.2
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.6.1
82
+ version: 0.6.2
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: gli
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -131,8 +131,6 @@ extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
133
  - ".gitignore"
134
- - ".idea/misc.xml"
135
- - ".idea/modules.xml"
136
134
  - ".idea/vcs.xml"
137
135
  - ".ruby-version"
138
136
  - ".travis.yml"
@@ -151,6 +149,7 @@ files:
151
149
  - lib/lmcadm/UUID.rb
152
150
  - lib/lmcadm/account_commands.rb
153
151
  - lib/lmcadm/cloud_commands.rb
152
+ - lib/lmcadm/commands/completion.rb
154
153
  - lib/lmcadm/commands/maintenance.rb
155
154
  - lib/lmcadm/commands/principal.rb
156
155
  - lib/lmcadm/commands/privatecloud.rb
@@ -159,7 +158,6 @@ files:
159
158
  - lib/lmcadm/device_commands.rb
160
159
  - lib/lmcadm/helpers/password_helper.rb
161
160
  - lib/lmcadm/helpers/string_helpers.rb
162
- - lib/lmcadm/test_command_container.rb
163
161
  - lib/lmcadm/version.rb
164
162
  - lmcadm
165
163
  - lmcadm.gemspec
data/.idea/misc.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 1.9.3-p551" project-jdk-type="RUBY_SDK" />
4
- </project>
data/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/lmcadm.iml" filepath="$PROJECT_DIR$/.idea/lmcadm.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,25 +0,0 @@
1
- require 'gli'
2
- module LMCAdm
3
- include ::GLI::App
4
- extend self
5
- #command :cloudiadirect do |c|
6
- # c.action do
7
- # puts 'direkt!!!!!'
8
- # end
9
- #end
10
- class TestCommandContainer
11
-
12
-
13
- #desc 'Check cloud connectivity'
14
- #command :cloud do |c|
15
- # c.action do |global_options|
16
- # lmcen = LMC::Cloud.new(global_options[:cloud_host], global_options[:user], global_options[:password])
17
- # puts "Base URL: #{lmcen.build_url}"
18
- # puts "Cloud connection OK" if lmcen.auth_ok
19
- # if global_options[:v]
20
- # puts "authentication token: " + lmcen.session_token
21
- # end
22
- # end
23
- #end
24
- end
25
- end