maas-client 0.1.24 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4909834732e25bcc549c997a8691da4e6a4d70a
4
- data.tar.gz: df1a42b383a7fb990aa8b04229bb88132c35da80
3
+ metadata.gz: 73f12e91e3767fe4270994c37beda74dbc41b39d
4
+ data.tar.gz: 3c0b49ad32f9b91914d7b200687aa1209e8ee0c2
5
5
  SHA512:
6
- metadata.gz: e955f95eda898f7ea634fdc5b843edb6be22da8e961a948853f9dddcc0e3887ac0783051d1c846e66b796dfb8866002585367ba972b65c2f0fc7e637900283b4
7
- data.tar.gz: a5df8779c9a21ebb259a26dfa70870b8c562a290129a7e199e4b8dccae71f8edea23580c69e7044d1102f000af78d27192d1a2817db304d45ceaac2ad575c48d
6
+ metadata.gz: 721562802f3f31e1b5c6c897abc56e6e07a9c02bf9c77dcacdfb1958cb319921fbe4dd12f6cd56da5c8a370fa16a890b9b13aca62f12dcf0a730ab969bccc39a
7
+ data.tar.gz: d916bdb2dced86c79db2529087031235781a41317993f8b28005229d8c6918e98f9f46000e586d930b867c513043a846d8352b63ca379cda38c13d10ebfcb63e
data/README.md CHANGED
@@ -48,9 +48,11 @@ dns_records = con.request(:get, ['dnsresources'])
48
48
  dns_records.each_with_index { |item, index| myarr << item['fqdn'] }
49
49
  myarr
50
50
 
51
-
52
51
  ```
53
-
52
+ ```bash
53
+ # to generate hosts file
54
+ rbmaas generate hosts
55
+ ```
54
56
  ## Development and Contribution
55
57
 
56
58
  Questions and pull requests are always welcome!
@@ -64,6 +64,13 @@ module Maas
64
64
  conn.request(:get, ['dnsresources']).each do |d|
65
65
  records << { ip: d['ip_addresses'][0]['ip'], fqdn: d['fqdn'] }
66
66
  end
67
+
68
+ conn.request(:get, ['machines']).each do |m|
69
+ if m['ip_addresses'] != []
70
+ records << { ip: m['ip_addresses'][0], fqdn: m['fqdn'] }
71
+ end
72
+ end
73
+
67
74
  records.sort_by! { |h| h[:fqdn] }
68
75
  domain = conn.request(:get, ['domains'])[0]['name']
69
76
  to_slice = ".#{domain}"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Maas
4
4
  module Client
5
- VERSION = '0.1.24'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maas-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Draper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-31 00:00:00.000000000 Z
11
+ date: 2017-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake