Statistics
| Branch: | Tag: | Revision:

one / src / vmm_mad / remotes / ec2 / poll @ 8cd7d0df

History | View | Annotate | Download (1.7 KB)

1
#!/usr/bin/env ruby
2

    
3
# -------------------------------------------------------------------------- #
4
# Copyright 2002-2017, OpenNebula Project, OpenNebula Systems                #
5
#                                                                            #
6
# Licensed under the Apache License, Version 2.0 (the "License"); you may    #
7
# not use this file except in compliance with the License. You may obtain    #
8
# a copy of the License at                                                   #
9
#                                                                            #
10
# http://www.apache.org/licenses/LICENSE-2.0                                 #
11
#                                                                            #
12
# Unless required by applicable law or agreed to in writing, software        #
13
# distributed under the License is distributed on an "AS IS" BASIS,          #
14
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
15
# See the License for the specific language governing permissions and        #
16
# limitations under the License.                                             #
17
# -------------------------------------------------------------------------- #
18

    
19
ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION)
20

    
21
if !ONE_LOCATION
22
    RUBY_LIB_LOCATION="/usr/lib/one/ruby" if !defined?(RUBY_LIB_LOCATION)
23
else
24
    RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" if !defined?(RUBY_LIB_LOCATION)
25
end
26

    
27
$: << RUBY_LIB_LOCATION
28
$: << File.dirname(__FILE__)
29

    
30
require 'ec2_driver'
31

    
32
deploy_id = ARGV[0]
33
host      = ARGV[1]
34
id        = ARGV[2]
35

    
36

    
37
begin
38
    ec2_drv = EC2Driver.new(host)
39
    ec2_drv.poll(id, deploy_id)
40
rescue Excetion => e
41
    handle_exception("Poll", e, host, deploy_id, id)
42
end