knife-maas 1.1.2.pre → 1.1.3.pre
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 098cec2c19b768d4af4e30431c2c7c97dbcbd70f
|
4
|
+
data.tar.gz: 259d8b7646d570680352bb60cfca067c7634a68d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 737b60942323354f6a4a47a85d50c9f4b883bd2dd7042ad5c52baebca979f1fcedac6b47ec11b0ca9ff80c9c6f17769d25af49ebe3d8f5cb56379e74aa55485f
|
7
|
+
data.tar.gz: 42e5885b0f06d662f37f94446c702a3c20d26cc07733f75c5dc4e6fe11be9d432f0965867359b27d121b0fd937fecbe26b4d6e0a83c708a55769e55e672d576e
|
data/lib/chef/knife/maas_base.rb
CHANGED
@@ -50,8 +50,19 @@ class Chef
|
|
50
50
|
Chef::Config[:knife][key] || config[key]
|
51
51
|
end
|
52
52
|
|
53
|
+
def validate!(keys=[:hostname, :system_id])
|
54
|
+
errors = []
|
53
55
|
|
56
|
+
keys.each do |k|
|
57
|
+
if Chef::Config[:knife][k].nil?
|
58
|
+
errors << "You did not provide a valid '#{k}' value."
|
59
|
+
end
|
60
|
+
end
|
54
61
|
|
62
|
+
if errors.each{|e| ui.error(e)}.any?
|
63
|
+
exit 1
|
64
|
+
end
|
65
|
+
end
|
55
66
|
end
|
56
67
|
end
|
57
68
|
end
|
@@ -13,19 +13,19 @@ class Chef
|
|
13
13
|
option :hostname,
|
14
14
|
:short => "-h HOSTNAME",
|
15
15
|
:long => "--hostname HOSTNAME",
|
16
|
-
:description => "The HOSTNAME inside of
|
16
|
+
:description => "The HOSTNAME inside of MAAS"
|
17
17
|
|
18
18
|
option :system_id,
|
19
19
|
:short => "-s SYSTEM_ID",
|
20
20
|
:long => "--system-id SYSTEM_ID",
|
21
|
-
:description => "The System ID inside of
|
21
|
+
:description => "The System ID inside of MAAS"
|
22
22
|
|
23
23
|
option :purge,
|
24
24
|
:short => "-P",
|
25
25
|
:long => "--purge",
|
26
26
|
:boolean => true,
|
27
27
|
:default => false,
|
28
|
-
:description => "Destroy corresponding node and client on the Chef Server, in addition to releasing the
|
28
|
+
:description => "Destroy corresponding node and client on the Chef Server, in addition to releasing the MAAS node itself. Assumes node and client have the same name as the server."
|
29
29
|
|
30
30
|
def destroy_item(klass, name, type_name)
|
31
31
|
begin
|
@@ -38,6 +38,9 @@ class Chef
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def run
|
41
|
+
|
42
|
+
validate!
|
43
|
+
|
41
44
|
system_id = locate_config_value(:system_id)
|
42
45
|
hostname = locate_config_value(:hostname)
|
43
46
|
|