mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Client class now exposes one_auth variable
git-svn-id: http://svn.opennebula.org/one/trunk@718 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
parent
2a4496020b
commit
f065251d92
@ -51,6 +51,8 @@ module OpenNebula
|
||||
# xml-rpc calls.
|
||||
# -------------------------------------------------------------------------
|
||||
class Client
|
||||
attr_accessor :one_auth
|
||||
|
||||
begin
|
||||
require 'xmlparser'
|
||||
XMLPARSER=true
|
||||
|
@ -91,7 +91,12 @@ end
|
||||
def get_one_client_user(user_name)
|
||||
user=get_user(user_name)
|
||||
|
||||
Client.new("#{user[:name]}:#{user[:password]}")
|
||||
|
||||
auth="#{user[:name]}:#{user[:password]}"
|
||||
|
||||
client=Client.new("dummy:dummy")
|
||||
client.one_auth=auth
|
||||
client
|
||||
end
|
||||
|
||||
def get_user(name)
|
||||
@ -120,7 +125,6 @@ def render_state(vm)
|
||||
end
|
||||
|
||||
def render_launch_time(vm)
|
||||
pp vm[:stime]
|
||||
"<launchTime>#{Time.at(vm[:stime].to_i).xmlschema}</launchTime>"
|
||||
end
|
||||
|
||||
@ -202,7 +206,9 @@ end
|
||||
def describe_instances(params)
|
||||
@user=get_user(params['AWSAccessKeyId'])
|
||||
|
||||
@vmpool=VirtualMachinePool.new(get_one_client_user(@user[:name]))
|
||||
client=get_one_client_user(@user[:name])
|
||||
|
||||
@vmpool=VirtualMachinePool.new(client)
|
||||
@vmpool.info
|
||||
|
||||
pp @vmpool
|
||||
@ -298,7 +304,7 @@ __END__
|
||||
</groupSet>
|
||||
<instancesSet>
|
||||
<% @vmpool.each do |vm| %>
|
||||
<% vm.info %>
|
||||
<% vm.info ; pp vm ; puts 'hostia' %>
|
||||
<item>
|
||||
<instanceId><%= vm.id %></instanceId>
|
||||
<imageId><%= vm['TEMPLATE/IMAGE_ID'] %></imageId>
|
||||
|
Loading…
x
Reference in New Issue
Block a user