right_link 5.9.2 → 5.9.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,54 +0,0 @@
1
- #
2
- # Copyright (c) 2012-2013 RightScale Inc
3
- #
4
- # Permission is hereby granted, free of charge, to any person obtaining
5
- # a copy of this software and associated documentation files (the
6
- # "Software"), to deal in the Software without restriction, including
7
- # without limitation the rights to use, copy, modify, merge, publish,
8
- # distribute, sublicense, and/or sell copies of the Software, and to
9
- # permit persons to whom the Software is furnished to do so, subject to
10
- # the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be
13
- # included in all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
-
23
- # set abbreviation for env var generation to be same as legacy Rackspace for scripters.
24
- abbreviation :rax
25
-
26
- # extend legacy Rackspace cloud definition. currently there are no differences aside from name.
27
- extend_cloud :rackspace
28
-
29
- # Updates the given node with cloudstack details.
30
- #
31
- # === Return
32
- # always true
33
- def update_details
34
- details = {}
35
- if ohai = @options[:ohai_node]
36
- if platform.windows?
37
- details[:public_ip] = ::RightScale::CloudUtilities.ip_for_windows_interface(ohai, 'public')
38
- details[:private_ip] = ::RightScale::CloudUtilities.ip_for_windows_interface(ohai, 'private')
39
- else
40
- details[:public_ip] = ::RightScale::CloudUtilities.ip_for_interface(ohai, :eth0)
41
- details[:private_ip] = ::RightScale::CloudUtilities.ip_for_interface(ohai, :eth1)
42
- end
43
- end
44
-
45
- # rack_connect (and managed?) instances may not have network interfaces for
46
- # public ip, so attempt the "what's my ip?" method in these cases.
47
- unless details[:public_ip]
48
- if public_ip = ::RightScale::CloudUtilities.query_whats_my_ip(:logger=>logger)
49
- details[:public_ip] = public_ip
50
- end
51
- end
52
-
53
- return details
54
- end