cloud66_agent 1.0.7.pre1 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ module Cloud66
16
16
  MAJOR, MINOR, PATCH = 1, 0, 7
17
17
 
18
18
  #ie. PRERELEASE_MODIFIER = 'beta1'
19
- PRERELEASE_MODIFIER = 'pre1'
19
+ PRERELEASE_MODIFIER = nil
20
20
 
21
21
  ##
22
22
  # Returns the major version ( big release based off of multiple minor releases )
@@ -12,16 +12,14 @@ module Cloud66
12
12
 
13
13
  def self.address_info
14
14
  # address information
15
- hash = parse_data(`facter ipaddress ipaddress_eth0 ipaddress6 ipaddress6_eth0 ec2_ami_id`)
15
+ hash = parse_data(`facter ipaddress ec2_public_ipv4 ipaddress_eth0 ipaddress6 ipaddress6_eth0`)
16
16
 
17
17
  result = {}
18
- # AWS special case
19
- if hash.has_key?('ec2_ami_id')
20
- # set ec2 external ip address
21
- reported_ip = `/usr/bin/curl http://169.254.169.254/latest/meta-data/public-ipv4`
22
- result[:ext_ipv4] = reported_ip if reported_ip =~ /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
23
- else
24
- # set general external ip address
18
+ if hash.has_key?('ec2_public_ipv4')
19
+ # return ec2 info first (most specific)
20
+ result[:ext_ipv4] = hash['ec2_public_ipv4']
21
+ elsif hash.has_key?('ipaddress')
22
+ # return ip address next (general)
25
23
  result[:ext_ipv4] = hash['ipaddress']
26
24
  end
27
25
  result[:int_ipv4] = hash['ipaddress_eth0'] if hash.has_key?('ipaddress_eth0')
@@ -29,7 +27,7 @@ module Cloud66
29
27
  result[:int_ipv6] = hash['ipaddress6_eth0'] if hash.has_key?('ipaddress6_eth0')
30
28
 
31
29
  # don't have any ip address info
32
- raise 'no address information' if result.empty? || !result.has_key?(:ext_ipv4)
30
+ raise "no address information" if result.empty? || !result.has_key?(:ext_ipv4)
33
31
 
34
32
  # return ip address info
35
33
  return result
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud66_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7.pre1
5
- prerelease: 6
4
+ version: 1.0.7
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Cloud 66
@@ -151,9 +151,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
151
  required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  none: false
153
153
  requirements:
154
- - - ! '>'
154
+ - - ! '>='
155
155
  - !ruby/object:Gem::Version
156
- version: 1.3.1
156
+ version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
159
  rubygems_version: 1.8.25