appflow: Use group_id and owner_id as chown/chgrp params

This commit is contained in:
Daniel Molina committed 2012-09-19 12:24:58 +02:00
1 parent 0723994dfa
commit 6b90f5265f
2 files changed
+8 -8

No files matched your search

+3 -3
View File
@@ -377,7 +377,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
Service.perform_actions(args[0]) { |service_id|
params = Hash.new
params['gid'] = args[1].to_i
params['group_id'] = args[1].to_i
json_action = Service.build_json_action('chgrp', params)
@@ -398,8 +398,8 @@ cmd=CommandParser::CmdParser.new(ARGV) do
Service.perform_actions(args[0]) { |service_id|
params = Hash.new
params['uid'] = args[1]
params['gid'] = args[2] if args[2]
params['owner_id'] = args[1]
params['group_id'] = args[2] if args[2]
json_action = Service.build_json_action('chown', params)
+5 -5
View File
@@ -228,10 +228,10 @@ post '/service/:id/action' do
service.shutdown
end
when 'chown'
if opts && opts['uid']
if opts && opts['owner_id']
args = Array.new
args << opts['uid'].to_i
args << (opts['gid'].to_i || -1)
args << opts['owner_id'].to_i
args << (opts['group_id'].to_i || -1)
service.chown(*args)
else
@@ -239,8 +239,8 @@ post '/service/:id/action' do
"You have to specify a UID")
end
when 'chgrp'
if opts && opts['gid']
service.chown(-1, opts['gid'].to_i)
if opts && opts['group_id']
service.chown(-1, opts['group_id'].to_i)
else
OpenNebula::Error.new("Action #{action['perform']}: " <<
"You have to specify a GID")