opennebula 6.6.2 → 6.7.80.pre
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 +4 -4
- data/lib/DriverExecHelper.rb +1 -1
- data/lib/HostSyncManager.rb +111 -0
- data/lib/cloud/CloudClient.rb +1 -1
- data/lib/host.rb +1 -1
- data/lib/opennebula/acl.rb +2 -1
- data/lib/opennebula/backupjob.rb +250 -0
- data/lib/opennebula/backupjob_pool.rb +82 -0
- data/lib/opennebula/client.rb +2 -2
- data/lib/opennebula/group.rb +1 -1
- data/lib/opennebula/ldap_auth.rb +2 -2
- data/lib/opennebula/lockable_ext.rb +1 -0
- data/lib/opennebula/oneflow_client.rb +115 -108
- data/lib/opennebula/pool_element.rb +48 -47
- data/lib/opennebula/ssh_auth.rb +102 -79
- data/lib/opennebula/virtual_machine.rb +297 -299
- data/lib/opennebula/vm_group.rb +35 -1
- data/lib/opennebula.rb +3 -1
- data/lib/virtual_wire.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c791a9b245b95bd0627930d9f17845003130bec8aba4e363997e583725399b0
|
4
|
+
data.tar.gz: bef534bfd10f3b9453101a4d639d6ad2a79a2c70b2b34e44c8502d51b83b25c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c5b274de24813610fe09de2db614024f719d67b4987e6020b6cf403998f0386c866534f4db702287bb5f9e6ae8943e4ad489f3efad2334b57a4cf73362638ef
|
7
|
+
data.tar.gz: 0420c6b94f5ad7df4270cd76ff3525d529fa69f82dbaf6aa408bd8bf2d06002832acf5e9e9ed06ee07e7bd4d2b8ca4cd37c5bb557c9898252588c9434c923b4e
|
data/lib/DriverExecHelper.rb
CHANGED
@@ -0,0 +1,111 @@
|
|
1
|
+
# -------------------------------------------------------------------------- #
|
2
|
+
# Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
|
3
|
+
# #
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
|
+
# not use this file except in compliance with the License. You may obtain #
|
6
|
+
# a copy of the License at #
|
7
|
+
# #
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
9
|
+
# #
|
10
|
+
# Unless required by applicable law or agreed to in writing, software #
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
13
|
+
# See the License for the specific language governing permissions and #
|
14
|
+
# limitations under the License. #
|
15
|
+
# -------------------------------------------------------------------------- #
|
16
|
+
|
17
|
+
# rubocop:disable Lint/MissingCopEnableDirective
|
18
|
+
# rubocop:disable Layout/FirstArgumentIndentation
|
19
|
+
# rubocop:disable Layout/FirstHashElementIndentation
|
20
|
+
# rubocop:disable Layout/HashAlignment
|
21
|
+
# rubocop:disable Layout/HeredocIndentation
|
22
|
+
# rubocop:disable Layout/IndentationWidth
|
23
|
+
# rubocop:disable Style/HashSyntax
|
24
|
+
# rubocop:disable Style/ParallelAssignment
|
25
|
+
|
26
|
+
require 'CommandManager'
|
27
|
+
|
28
|
+
# This helper module introduces a common routine that synchronizes
|
29
|
+
# the "remotes".
|
30
|
+
class HostSyncManager
|
31
|
+
|
32
|
+
def initialize(one_config = nil)
|
33
|
+
one_location = ENV['ONE_LOCATION']&.delete("'")
|
34
|
+
if one_location.nil?
|
35
|
+
@one_config_path = '/var/lib/one/config'
|
36
|
+
@local_scripts_base_path = '/var/lib/one/remotes'
|
37
|
+
else
|
38
|
+
@one_config_path = one_location + '/var/config'
|
39
|
+
@local_scripts_base_path = one_location + '/var/remotes'
|
40
|
+
end
|
41
|
+
|
42
|
+
# Do a simple parsing of the config file unless the values
|
43
|
+
# are already provided. NOTE: We don't care about "arrays" here..
|
44
|
+
one_config ||= File.read(@one_config_path).lines.each_with_object({}) \
|
45
|
+
do |line, object|
|
46
|
+
key, value = line.split('=').map(&:strip)
|
47
|
+
object[key.upcase] = value
|
48
|
+
end
|
49
|
+
|
50
|
+
@remote_scripts_base_path = one_config['SCRIPTS_REMOTE_DIR']
|
51
|
+
@remote_scripts_base_path&.delete!("'")
|
52
|
+
end
|
53
|
+
|
54
|
+
def update_remotes(hostname, logger = nil, copy_method = :rsync, subset = nil)
|
55
|
+
sources = '.'
|
56
|
+
|
57
|
+
if subset && copy_method == :rsync
|
58
|
+
# Make sure all files in the subset exist (and are relative).
|
59
|
+
subset.each do |path|
|
60
|
+
File.realpath path, @local_scripts_base_path
|
61
|
+
end
|
62
|
+
|
63
|
+
sources = subset.join(' ')
|
64
|
+
end
|
65
|
+
|
66
|
+
assemble_cmd = lambda do |steps|
|
67
|
+
"exec 2>/dev/null; #{steps.join(' && ')}"
|
68
|
+
end
|
69
|
+
|
70
|
+
case copy_method
|
71
|
+
when :ssh
|
72
|
+
mkdir_cmd = assemble_cmd.call [
|
73
|
+
"rm -rf '#{@remote_scripts_base_path}'/",
|
74
|
+
"mkdir -p '#{@remote_scripts_base_path}'/"
|
75
|
+
]
|
76
|
+
|
77
|
+
sync_cmd = assemble_cmd.call [
|
78
|
+
"cd '#{@local_scripts_base_path}'/",
|
79
|
+
"scp -rp #{sources} " \
|
80
|
+
"'#{hostname}':'#{@remote_scripts_base_path}'/"
|
81
|
+
]
|
82
|
+
when :rsync
|
83
|
+
mkdir_cmd = assemble_cmd.call [
|
84
|
+
"mkdir -p '#{@remote_scripts_base_path}'/"
|
85
|
+
]
|
86
|
+
|
87
|
+
sync_cmd = assemble_cmd.call [
|
88
|
+
"cd '#{@local_scripts_base_path}'/",
|
89
|
+
"rsync -LRaz --delete #{sources} " \
|
90
|
+
"'#{hostname}':'#{@remote_scripts_base_path}'/"
|
91
|
+
]
|
92
|
+
end
|
93
|
+
|
94
|
+
cmd = SSHCommand.run(mkdir_cmd, hostname, logger)
|
95
|
+
return cmd.code if error?(cmd)
|
96
|
+
|
97
|
+
cmd = LocalCommand.run(sync_cmd, logger)
|
98
|
+
return cmd.code if error?(cmd)
|
99
|
+
|
100
|
+
0
|
101
|
+
end
|
102
|
+
|
103
|
+
def error?(cmd)
|
104
|
+
return false if cmd.code == 0
|
105
|
+
|
106
|
+
STDERR.puts cmd.stderr
|
107
|
+
STDOUT.puts cmd.stdout
|
108
|
+
true
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
data/lib/cloud/CloudClient.rb
CHANGED
data/lib/host.rb
CHANGED
@@ -352,7 +352,7 @@ module VCenterDriver
|
|
352
352
|
str_info << 'USEDMEMORY=' << (total_mem - free_mem).to_s << "\n"
|
353
353
|
|
354
354
|
# DRS enabled
|
355
|
-
str_info << 'VCENTER_DRS='
|
355
|
+
str_info << 'VCENTER_DRS=' << drs_enabled.to_s << "\n"
|
356
356
|
|
357
357
|
# HA enabled
|
358
358
|
str_info << 'VCENTER_HA=' << ha_enabled.to_s << "\n"
|
data/lib/opennebula/acl.rb
CHANGED
@@ -0,0 +1,250 @@
|
|
1
|
+
# -------------------------------------------------------------------------- #
|
2
|
+
# Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
|
3
|
+
# #
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
|
+
# not use this file except in compliance with the License. You may obtain #
|
6
|
+
# a copy of the License at #
|
7
|
+
# #
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
9
|
+
# #
|
10
|
+
# Unless required by applicable law or agreed to in writing, software #
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
13
|
+
# See the License for the specific language governing permissions and #
|
14
|
+
# limitations under the License. #
|
15
|
+
#--------------------------------------------------------------------------- #
|
16
|
+
|
17
|
+
require 'opennebula/lockable_ext'
|
18
|
+
require 'opennebula/pool_element'
|
19
|
+
|
20
|
+
module OpenNebula
|
21
|
+
|
22
|
+
# Class for representing a Backup Job object
|
23
|
+
class BackupJob < PoolElement
|
24
|
+
|
25
|
+
#######################################################################
|
26
|
+
# Constants and Class Methods
|
27
|
+
#######################################################################
|
28
|
+
|
29
|
+
BACKUPJOB_METHODS = {
|
30
|
+
:allocate => 'backupjob.allocate',
|
31
|
+
:info => 'backupjob.info',
|
32
|
+
:update => 'backupjob.update',
|
33
|
+
:delete => 'backupjob.delete',
|
34
|
+
:chown => 'backupjob.chown',
|
35
|
+
:chmod => 'backupjob.chmod',
|
36
|
+
:clone => 'backupjob.clone',
|
37
|
+
:rename => 'backupjob.rename',
|
38
|
+
:lock => 'backupjob.lock',
|
39
|
+
:unlock => 'backupjob.unlock',
|
40
|
+
:backup => 'backupjob.backup',
|
41
|
+
:cancel => 'backupjob.cancel',
|
42
|
+
:retry => 'backupjob.retry',
|
43
|
+
:priority => 'backupjob.priority',
|
44
|
+
:schedadd => 'backupjob.schedadd',
|
45
|
+
:scheddelete => 'backupjob.scheddelete',
|
46
|
+
:schedupdate => 'backupjob.schedupdate'
|
47
|
+
}
|
48
|
+
|
49
|
+
# Creates a BackupJob description with just its identifier
|
50
|
+
# this method should be used to create plain BackupJob objects.
|
51
|
+
# +id+ the id of the user
|
52
|
+
#
|
53
|
+
# Example:
|
54
|
+
# bj = BackupJob.new(BackupJob.build_xml(3),rpc_client)
|
55
|
+
#
|
56
|
+
def self.build_xml(pe_id = nil)
|
57
|
+
if pe_id
|
58
|
+
obj_xml = "<BACKUPJOB><ID>#{pe_id}</ID></BACKUPJOB>"
|
59
|
+
else
|
60
|
+
obj_xml = '<BACKUPJOB></BACKUPJOB>'
|
61
|
+
end
|
62
|
+
|
63
|
+
XMLElement.build_xml(obj_xml, 'BACKUPJOB')
|
64
|
+
end
|
65
|
+
|
66
|
+
# Class constructor
|
67
|
+
def initialize(xml, client)
|
68
|
+
LockableExt.make_lockable(self, BACKUPJOB_METHODS)
|
69
|
+
|
70
|
+
super(xml, client)
|
71
|
+
|
72
|
+
@client = client
|
73
|
+
end
|
74
|
+
|
75
|
+
#######################################################################
|
76
|
+
# XML-RPC Methods for the Backup Job Object
|
77
|
+
#######################################################################
|
78
|
+
|
79
|
+
# Retrieves the information of the given Backup Job.
|
80
|
+
def info
|
81
|
+
return Error.new('ID not defined') unless @pe_id
|
82
|
+
|
83
|
+
rc = @client.call(BACKUPJOB_METHODS[:info], @pe_id)
|
84
|
+
|
85
|
+
if !OpenNebula.is_error?(rc)
|
86
|
+
initialize_xml(rc, 'BACKUPJOB')
|
87
|
+
rc = nil
|
88
|
+
|
89
|
+
@pe_id = self['ID'].to_i if self['ID']
|
90
|
+
@name = self['NAME'] if self['NAME']
|
91
|
+
end
|
92
|
+
|
93
|
+
rc
|
94
|
+
end
|
95
|
+
|
96
|
+
alias info! info
|
97
|
+
|
98
|
+
# Allocates a new Backup Job in OpenNebula
|
99
|
+
#
|
100
|
+
# @param description [String] The contents of the BackupJob.
|
101
|
+
#
|
102
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
103
|
+
# otherwise
|
104
|
+
def allocate(description)
|
105
|
+
super(BACKUPJOB_METHODS[:allocate], description)
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deletes the BackupJob
|
109
|
+
#
|
110
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
111
|
+
# otherwise
|
112
|
+
def delete
|
113
|
+
call(BACKUPJOB_METHODS[:delete], @pe_id)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Replaces the Backup Job contents
|
117
|
+
#
|
118
|
+
# @param new_template [String] New template contents
|
119
|
+
# @param append [true, false] True to append new attributes instead of
|
120
|
+
# replace the whole template
|
121
|
+
#
|
122
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
123
|
+
# otherwise
|
124
|
+
def update(new_template, append = false)
|
125
|
+
super(BACKUPJOB_METHODS[:update], new_template, append ? 1 : 0)
|
126
|
+
end
|
127
|
+
|
128
|
+
# Changes the owner/group
|
129
|
+
# uid:: _Integer_ the new owner id. Set to -1 to leave the current one
|
130
|
+
# gid:: _Integer_ the new group id. Set to -1 to leave the current one
|
131
|
+
# [return] nil in case of success or an Error object
|
132
|
+
def chown(uid, gid)
|
133
|
+
super(BACKUPJOB_METHODS[:chown], uid, gid)
|
134
|
+
end
|
135
|
+
|
136
|
+
# Changes the Backup Job permissions.
|
137
|
+
#
|
138
|
+
# @param octet [String] Permissions octed , e.g. 640
|
139
|
+
#
|
140
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
141
|
+
# otherwise
|
142
|
+
def chmod_octet(octet)
|
143
|
+
super(BACKUPJOB_METHODS[:chmod], octet)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Changes the Backup Job permissions.
|
147
|
+
# Each [Integer] argument must be 1 to allow, 0 deny, -1 do not change
|
148
|
+
#
|
149
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
150
|
+
# otherwise
|
151
|
+
# rubocop:disable Metrics/ParameterLists
|
152
|
+
def chmod(owner_u, owner_m, owner_a, group_u, group_m, group_a, other_u,
|
153
|
+
other_m, other_a)
|
154
|
+
call(BACKUPJOB_METHODS[:chmod], @pe_id, owner_u, owner_m, owner_a, group_u,
|
155
|
+
group_m, group_a, other_u, other_m, other_a)
|
156
|
+
end
|
157
|
+
# rubocop:enable Metrics/ParameterLists
|
158
|
+
|
159
|
+
# Renames this Backup Job
|
160
|
+
#
|
161
|
+
# @param name [String] New name for the Backup Job.
|
162
|
+
#
|
163
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
164
|
+
# otherwise
|
165
|
+
def rename(name)
|
166
|
+
call(BACKUPJOB_METHODS[:rename], @pe_id, name)
|
167
|
+
end
|
168
|
+
|
169
|
+
# Starts the Backup Job
|
170
|
+
#
|
171
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
172
|
+
# otherwise
|
173
|
+
def backup
|
174
|
+
call(BACKUPJOB_METHODS[:backup], @pe_id)
|
175
|
+
end
|
176
|
+
|
177
|
+
# Cancel pending Backup Job, removing VMs from waiting list
|
178
|
+
#
|
179
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
180
|
+
# otherwise
|
181
|
+
def cancel
|
182
|
+
call(BACKUPJOB_METHODS[:cancel], @pe_id)
|
183
|
+
end
|
184
|
+
|
185
|
+
# Retry backup for VMs in error list
|
186
|
+
#
|
187
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
188
|
+
# otherwise
|
189
|
+
def retry
|
190
|
+
call(BACKUPJOB_METHODS[:retry], @pe_id)
|
191
|
+
end
|
192
|
+
|
193
|
+
# Change priority of Backup Job
|
194
|
+
#
|
195
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
196
|
+
# otherwise
|
197
|
+
def priority(pr)
|
198
|
+
call(BACKUPJOB_METHODS[:priority], @pe_id, pr)
|
199
|
+
end
|
200
|
+
|
201
|
+
# Add Scheduled action
|
202
|
+
#
|
203
|
+
# @param sched_template [String] Template with SCHED_ACTIONs
|
204
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
205
|
+
# otherwise
|
206
|
+
def sched_action_add(sched_template)
|
207
|
+
call(BACKUPJOB_METHODS[:schedadd], @pe_id, sched_template)
|
208
|
+
end
|
209
|
+
|
210
|
+
# Delete Scheduled Action
|
211
|
+
#
|
212
|
+
# @param sched_id [Int] id of the SCHED_ACTION
|
213
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
214
|
+
# otherwise
|
215
|
+
def sched_action_delete(sched_id)
|
216
|
+
call(BACKUPJOB_METHODS[:scheddelete], @pe_id, sched_id.to_i)
|
217
|
+
end
|
218
|
+
|
219
|
+
# Update Scheduled Action
|
220
|
+
#
|
221
|
+
# @param sched_id [Int] id of the SCHED_ACTION
|
222
|
+
# @param sched_template [String] Template containing a SCHED_ACTION
|
223
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
224
|
+
# otherwise
|
225
|
+
def sched_action_update(sched_id, sched_template)
|
226
|
+
call(BACKUPJOB_METHODS[:schedupdate], @pe_id,
|
227
|
+
sched_id.to_i, sched_template)
|
228
|
+
end
|
229
|
+
|
230
|
+
#######################################################################
|
231
|
+
# Helpers to get Template information
|
232
|
+
#######################################################################
|
233
|
+
|
234
|
+
# Returns the group identifier
|
235
|
+
# [return] _Integer_ the element's group ID
|
236
|
+
def gid
|
237
|
+
self['GID'].to_i
|
238
|
+
end
|
239
|
+
|
240
|
+
def owner_id
|
241
|
+
self['UID'].to_i
|
242
|
+
end
|
243
|
+
|
244
|
+
def public?
|
245
|
+
self['PERMISSIONS/GROUP_U'] == '1' || self['PERMISSIONS/OTHER_U'] == '1'
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|
249
|
+
|
250
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# -------------------------------------------------------------------------- #
|
2
|
+
# Copyright 2002-2023, OpenNebula Project, OpenNebula Systems #
|
3
|
+
# #
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
|
+
# not use this file except in compliance with the License. You may obtain #
|
6
|
+
# a copy of the License at #
|
7
|
+
# #
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0 #
|
9
|
+
# #
|
10
|
+
# Unless required by applicable law or agreed to in writing, software #
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS, #
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
13
|
+
# See the License for the specific language governing permissions and #
|
14
|
+
# limitations under the License. #
|
15
|
+
#--------------------------------------------------------------------------- #
|
16
|
+
|
17
|
+
require 'opennebula/pool'
|
18
|
+
|
19
|
+
module OpenNebula
|
20
|
+
|
21
|
+
# Class representing a Backup Job pool
|
22
|
+
class BackupJobPool < Pool
|
23
|
+
|
24
|
+
#######################################################################
|
25
|
+
# Constants and Class attribute accessors
|
26
|
+
#######################################################################
|
27
|
+
|
28
|
+
BACKUPJOB_POOL_METHODS = {
|
29
|
+
:info => 'backupjobpool.info'
|
30
|
+
}
|
31
|
+
|
32
|
+
#######################################################################
|
33
|
+
# Class constructor & Pool Methods
|
34
|
+
#######################################################################
|
35
|
+
|
36
|
+
# +client+ a Client object that represents an XML-RPC connection
|
37
|
+
# +user_id+ used to refer to a Pool with Templates from that user
|
38
|
+
def initialize(client, user_id = -1)
|
39
|
+
super('BACKUPJOB_POOL', 'BACKUPJOB', client)
|
40
|
+
|
41
|
+
@user_id = user_id
|
42
|
+
end
|
43
|
+
|
44
|
+
# Factory method to create Backup Job objects
|
45
|
+
def factory(element_xml)
|
46
|
+
OpenNebula::BackupJob.new(element_xml, @client)
|
47
|
+
end
|
48
|
+
|
49
|
+
#######################################################################
|
50
|
+
# XML-RPC Methods for the Template Object
|
51
|
+
#######################################################################
|
52
|
+
|
53
|
+
# Retrieves all or part of the Templates in the pool.
|
54
|
+
def info(*args)
|
55
|
+
case args.size
|
56
|
+
when 0
|
57
|
+
info_filter(BACKUPJOB_POOL_METHODS[:info], @user_id, -1, -1)
|
58
|
+
when 3
|
59
|
+
info_filter(BACKUPJOB_POOL_METHODS[:info], args[0], args[1], args[2])
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def info_all
|
64
|
+
super(BACKUPJOB_POOL_METHODS[:info])
|
65
|
+
end
|
66
|
+
|
67
|
+
def info_mine
|
68
|
+
super(BACKUPJOB_POOL_METHODS[:info])
|
69
|
+
end
|
70
|
+
|
71
|
+
def info_group
|
72
|
+
super(BACKUPJOB_POOL_METHODS[:info])
|
73
|
+
end
|
74
|
+
|
75
|
+
alias info! info
|
76
|
+
alias info_all! info_all
|
77
|
+
alias info_mine! info_mine
|
78
|
+
alias info_group! info_group
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
data/lib/opennebula/client.rb
CHANGED
@@ -140,9 +140,9 @@ module OpenNebula
|
|
140
140
|
@one_endpoint = endpoint
|
141
141
|
elsif ENV["ONE_XMLRPC"]
|
142
142
|
@one_endpoint = ENV["ONE_XMLRPC"]
|
143
|
-
elsif ENV['HOME'] and File.
|
143
|
+
elsif ENV['HOME'] and File.exist?(ENV['HOME']+"/.one/one_endpoint")
|
144
144
|
@one_endpoint = File.read(ENV['HOME']+"/.one/one_endpoint")
|
145
|
-
elsif File.
|
145
|
+
elsif File.exist?("/var/lib/one/.one/one_endpoint")
|
146
146
|
@one_endpoint = File.read("/var/lib/one/.one/one_endpoint")
|
147
147
|
else
|
148
148
|
@one_endpoint = "http://localhost:2633/RPC2"
|
data/lib/opennebula/group.rb
CHANGED
@@ -37,7 +37,7 @@ module OpenNebula
|
|
37
37
|
SELF = -1
|
38
38
|
|
39
39
|
# Default resource ACL's for group users (create)
|
40
|
-
GROUP_DEFAULT_ACLS = "VM+IMAGE+TEMPLATE+DOCUMENT+SECGROUP+VROUTER+VMGROUP"
|
40
|
+
GROUP_DEFAULT_ACLS = "VM+IMAGE+TEMPLATE+DOCUMENT+SECGROUP+VROUTER+VMGROUP+BACKUPJOB"
|
41
41
|
|
42
42
|
# The default view for group and group admins, must be defined in
|
43
43
|
# sunstone_views.yaml
|
data/lib/opennebula/ldap_auth.rb
CHANGED
@@ -89,7 +89,7 @@ class OpenNebula::LdapAuth
|
|
89
89
|
file=@options[:mapping_file_path]
|
90
90
|
generate = false
|
91
91
|
|
92
|
-
if File.
|
92
|
+
if File.exist?(file)
|
93
93
|
stat = File.stat(file)
|
94
94
|
age = Time.now.to_i - stat.mtime.to_i
|
95
95
|
generate = true if age > @options[:mapping_timeout]
|
@@ -124,7 +124,7 @@ class OpenNebula::LdapAuth
|
|
124
124
|
|
125
125
|
@mapping = {}
|
126
126
|
|
127
|
-
if File.
|
127
|
+
if File.exist?(file)
|
128
128
|
@mapping = YAML.load(File.read(file))
|
129
129
|
end
|
130
130
|
|