~ubuntu-branches/debian/sid/opennebula/sid

« back to all changes in this revision

Viewing changes to src/oca/ruby/OpenNebula.rb

  • Committer: Package Import Robot
  • Author(s): Damien Raude-Morvan
  • Date: 2012-05-11 19:27:43 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120511192743-lnz8gog5uxzmx2f3
Tags: 3.4.1-1
* New upstream release:
  - d/patches/default_conf.diff: Drop, transfert manager is now handled
    on a datasatore basis.
  - d/patches/genisoimage.diff: Merged upstream.
  - d/patches/oneacct-system-wide-installation.patch: Merged upstream.
  - Refresh others patches.
  - Update *.install files.
* Improve OCCI Self-Service UI integration:
  - Install into /usr/share/opennebula/occi/.
  - occi_system_jquery.diff: Use system wide jquery/jqueryui.
  - Add Recommends: libjs-jquery, libjs-jquery-ui for opennebula package.
* Add Suggests: ruby-uuidtools for econe-server.
* Install more manpages from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
require 'OpenNebula/GroupPool'
43
43
require 'OpenNebula/Acl'
44
44
require 'OpenNebula/AclPool'
 
45
require 'OpenNebula/Datastore'
 
46
require 'OpenNebula/DatastorePool'
 
47
require 'OpenNebula/Cluster'
 
48
require 'OpenNebula/ClusterPool'
45
49
 
46
50
module OpenNebula
47
51
 
79
83
        value.class==OpenNebula::Error
80
84
    end
81
85
 
 
86
 
 
87
    if OpenNebula::NOKOGIRI
 
88
        class NokogiriStreamParser < XMLRPC::XMLParser::AbstractStreamParser
 
89
            def initialize
 
90
                @parser_class = NokogiriParser
 
91
            end
 
92
 
 
93
            class NokogiriParser < Nokogiri::XML::SAX::Document
 
94
                include XMLRPC::XMLParser::StreamParserMixin
 
95
 
 
96
                alias :cdata_block :character
 
97
                alias :characters :character
 
98
                alias :end_element :endElement
 
99
                alias :start_element :startElement
 
100
 
 
101
                def parse(str)
 
102
                    parser = Nokogiri::XML::SAX::Parser.new(self)
 
103
                    parser.parse(str)
 
104
                end
 
105
            end
 
106
        end
 
107
    end
 
108
 
 
109
 
82
110
    # The client class, represents the connection with the core and handles the
83
111
    # xml-rpc calls.
84
112
    class Client
113
141
            end
114
142
 
115
143
            @server = XMLRPC::Client.new2(@one_endpoint)
 
144
 
 
145
            if OpenNebula::NOKOGIRI
 
146
                @server.set_parser(NokogiriStreamParser.new)
 
147
            elsif XMLPARSER
 
148
                @server.set_parser(XMLRPC::XMLParser::XMLStreamParser.new)
 
149
            end
116
150
        end
117
151
 
118
152
        def call(action, *args)
119
 
 
120
 
            if XMLPARSER
121
 
                @server.set_parser(XMLRPC::XMLParser::XMLStreamParser.new)
122
 
            end
123
 
 
124
153
            begin
125
154
                response = @server.call_async("one."+action, @one_auth, *args)
126
155