mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
(cherry picked from commit becaf48344932bbd652f246d6f915709da5c7ddf)
This commit is contained in:
parent
762a0fa9e1
commit
308d304851
@ -94,7 +94,7 @@ class LXDClient
|
||||
def wait(response, timeout)
|
||||
operation_id = response['operation'].split('/').last
|
||||
|
||||
timeout = "?timeout=#{timeout}" if [nil, ''].include?(timeout)
|
||||
timeout = "?timeout=#{timeout}" unless [nil, ''].include?(timeout)
|
||||
|
||||
response = get("operations/#{operation_id}/wait#{timeout}")
|
||||
|
||||
|
@ -481,7 +481,6 @@ class Mapper
|
||||
|
||||
if o.empty?
|
||||
OpenNebula.log_error("#{err}#{e}")
|
||||
return false
|
||||
else
|
||||
cmd = "#{COMMANDS[:resize2fs]} #{device}"
|
||||
rc, _o, e = Command.execute(cmd, false)
|
||||
@ -511,7 +510,11 @@ class Mapper
|
||||
when /xfs/
|
||||
cmd = "#{COMMANDS[:xfs_admin]} -U generate #{device}"
|
||||
when /ext/
|
||||
Command.execute("#{COMMANDS[:e2fsck]} -f -y #{device}", false)
|
||||
cmd = "#{COMMANDS[:e2fsck]} -f -y #{device}"
|
||||
_rc, o, e = Command.execute(cmd, false)
|
||||
|
||||
OpenNebula.log e if o.empty?
|
||||
|
||||
cmd = "#{COMMANDS[:tune2fs]} -U random #{device}"
|
||||
else
|
||||
return true
|
||||
|
@ -27,6 +27,9 @@ class FSRawMapper < Mapper
|
||||
|
||||
def do_map(one_vm, disk, _directory)
|
||||
dsrc = one_vm.disk_source(disk)
|
||||
|
||||
File.chmod(0o646, dsrc) if File.symlink?(one_vm.sysds_path)
|
||||
|
||||
cmd = "#{COMMANDS[:losetup]} -f --show #{dsrc}"
|
||||
|
||||
rc, out, err = Command.execute(cmd, true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user