opennebula-cli 5.1.80.beta1 → 5.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/oneuser +33 -6
- data/lib/one_helper.rb +8 -6
- data/lib/one_helper/oneuser_helper.rb +6 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc61f6e7f892feb55e7f937e5118fd75a06dbcf8
|
4
|
+
data.tar.gz: 3848dae4195c901537b34a57ac30848851797379
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56289d0bcaee81b7cb480af29379f8ed79dfbbe66e8746d9826c7d1e65d2c540af0504c37565fbf4eac8f46c8c02fbb190745c99670cac463257a2affcdb3c7f
|
7
|
+
data.tar.gz: 8a4823dec3b60882a02b842d99b76ae401ab8d97db56f28d9422767338c196b92132004f4860357b48354f923ff08c1b0b24b70143580bb6642d07a559552b7b
|
data/bin/oneuser
CHANGED
@@ -40,7 +40,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
40
40
|
helper = OneUserHelper.new
|
41
41
|
|
42
42
|
before_proc do
|
43
|
-
helper.set_client(options) if ![:
|
43
|
+
helper.set_client(options) if ![:key].include?(@comm_name)
|
44
44
|
end
|
45
45
|
|
46
46
|
########################################################################
|
@@ -131,7 +131,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
131
131
|
:name => "driver",
|
132
132
|
:large => "--driver driver",
|
133
133
|
:format => String,
|
134
|
-
:description => "Driver to
|
134
|
+
:description => "Driver to authenticate this user"
|
135
135
|
}
|
136
136
|
|
137
137
|
FORCE = {
|
@@ -157,6 +157,28 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
157
157
|
}
|
158
158
|
}
|
159
159
|
|
160
|
+
GROUP_CREATE = {
|
161
|
+
:name => "group",
|
162
|
+
:large => "--group id|name" ,
|
163
|
+
:description => "Comma-separated list of Groups for the new User. "\
|
164
|
+
"The first Group will be the main one.",
|
165
|
+
:format => String,
|
166
|
+
:proc => lambda { |o, options|
|
167
|
+
gids = o.split(",").map { |g|
|
168
|
+
id = OpenNebulaHelper.rname_to_id(g, "GROUP")
|
169
|
+
|
170
|
+
if (id[0] == -1)
|
171
|
+
puts id[1]
|
172
|
+
exit -1
|
173
|
+
end
|
174
|
+
|
175
|
+
id[1]
|
176
|
+
}
|
177
|
+
|
178
|
+
[0, gids]
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
160
182
|
GLOBAL = {
|
161
183
|
:name => "global",
|
162
184
|
:large => "--global" ,
|
@@ -169,7 +191,9 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
169
191
|
:description => "enable stdin password"
|
170
192
|
}
|
171
193
|
|
172
|
-
|
194
|
+
auth_options = [READ_FILE, SHA1, SSH, X509, KEY, CERT, DRIVER]
|
195
|
+
|
196
|
+
create_options = auth_options.clone.unshift(GROUP_CREATE)
|
173
197
|
|
174
198
|
login_options = [SSH,
|
175
199
|
X509,
|
@@ -212,6 +236,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
212
236
|
Examples:
|
213
237
|
oneuser create my_user my_password
|
214
238
|
oneuser create my_user -r /tmp/mypass
|
239
|
+
oneuser create my_user my_password --group users,102,testers
|
215
240
|
oneuser create my_user --ssh --key /tmp/id_rsa
|
216
241
|
oneuser create my_user --ssh -r /tmp/public_key
|
217
242
|
oneuser create my_user --x509 --cert /tmp/my_cert.pem
|
@@ -232,8 +257,10 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
232
257
|
|
233
258
|
driver = options[:driver] || OpenNebula::User::CORE_AUTH
|
234
259
|
|
260
|
+
gids = options[:group] || []
|
261
|
+
|
235
262
|
helper.create_resource(options) do |user|
|
236
|
-
user.allocate(args[0], pass, driver)
|
263
|
+
user.allocate(args[0], pass, driver, gids)
|
237
264
|
end
|
238
265
|
end
|
239
266
|
|
@@ -411,7 +438,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
411
438
|
EOT
|
412
439
|
|
413
440
|
command :passwd, passwd_desc, :userid, [:password, nil],
|
414
|
-
:options=>
|
441
|
+
:options=>auth_options do
|
415
442
|
if args[1]
|
416
443
|
pass = args[1]
|
417
444
|
else
|
@@ -474,7 +501,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
474
501
|
EOT
|
475
502
|
|
476
503
|
command :chauth, chauth_desc, :userid, [:auth, nil], [:password, nil],
|
477
|
-
:options=>
|
504
|
+
:options=>auth_options do
|
478
505
|
if options[:driver]
|
479
506
|
driver = options[:driver]
|
480
507
|
elsif args[1]
|
data/lib/one_helper.rb
CHANGED
@@ -661,6 +661,7 @@ EOT
|
|
661
661
|
when "a", "all" then OpenNebula::Pool::INFO_ALL
|
662
662
|
when "m", "mine" then OpenNebula::Pool::INFO_MINE
|
663
663
|
when "g", "group" then OpenNebula::Pool::INFO_GROUP
|
664
|
+
when "G", "primary group" then OpenNebula::Pool::INFO_PRIMARY_GROUP
|
664
665
|
else
|
665
666
|
if str.match(/^[0123456789]+$/)
|
666
667
|
str.to_i
|
@@ -679,12 +680,13 @@ EOT
|
|
679
680
|
|
680
681
|
def self.filterflag_to_i_desc
|
681
682
|
desc=<<-EOT
|
682
|
-
a, all
|
683
|
-
m, mine
|
684
|
-
g, group
|
685
|
-
|
686
|
-
|
687
|
-
|
683
|
+
a, all all the known #{self.rname}s
|
684
|
+
m, mine the #{self.rname} belonging to the user in ONE_AUTH
|
685
|
+
g, group 'mine' plus the #{self.rname} belonging to the groups
|
686
|
+
the user is member of
|
687
|
+
G, primary group the #{self.rname} owned the user's primary group
|
688
|
+
uid #{self.rname} of the user identified by this uid
|
689
|
+
user #{self.rname} of the user identified by the username
|
688
690
|
EOT
|
689
691
|
end
|
690
692
|
|
@@ -28,7 +28,11 @@ end
|
|
28
28
|
|
29
29
|
class OneUserHelper < OpenNebulaHelper::OneHelper
|
30
30
|
|
31
|
-
|
31
|
+
if ENV['HOME']
|
32
|
+
ONE_AUTH = ENV['HOME']+'/.one/one_auth'
|
33
|
+
else
|
34
|
+
ONE_AUTH = "/var/lib/one/.one/one_auth"
|
35
|
+
end
|
32
36
|
|
33
37
|
def self.rname
|
34
38
|
"USER"
|
@@ -443,7 +447,7 @@ class OneUserHelper < OpenNebulaHelper::OneHelper
|
|
443
447
|
rc = user.info
|
444
448
|
if OpenNebula.is_error?(rc)
|
445
449
|
puts rc.message
|
446
|
-
|
450
|
+
exit 1
|
447
451
|
end
|
448
452
|
user
|
449
453
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opennebula-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opennebula
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.
|
19
|
+
version: 5.2.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: 5.
|
26
|
+
version: 5.2.0
|
27
27
|
description: Commands used to talk to OpenNebula
|
28
28
|
email: contact@opennebula.org
|
29
29
|
executables:
|
@@ -112,9 +112,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
112
|
version: '0'
|
113
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: '0'
|
118
118
|
requirements: []
|
119
119
|
rubyforge_project:
|
120
120
|
rubygems_version: 2.5.1
|