File tree Expand file tree Collapse file tree 5 files changed +16
-17
lines changed Expand file tree Collapse file tree 5 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ def initialize(options = {})
31
31
@error_message = nil
32
32
@catalog = nil
33
33
@catalog_json = nil
34
+ @retries = nil
34
35
35
36
# The compilation directory can be overridden, e.g. when testing
36
37
@override_compilation_dir = options [ :compilation_dir ]
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ def initialize(options)
39
39
@puppet_binary = options [ :puppet_binary ]
40
40
@puppet_version = options [ :puppet_version ]
41
41
@puppet_command = options [ :puppet_command ]
42
- @retries = nil
43
42
@builddir = nil
44
43
@facts_terminus = options . fetch ( :facts_terminus , 'yaml' )
45
44
end
Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ class JSON < OctocatalogDiff::Catalog
14
14
# @param :node [String] Node name (if not supplied, will be determined from catalog)
15
15
def initialize ( options )
16
16
super
17
- raise ArgumentError , "Must supply :json as string in options: #{ options [ :json ] . class } " unless options [ :json ] . is_a? ( String )
17
+
18
+ unless options [ :json ] . is_a? ( String )
19
+ raise ArgumentError , "Must supply :json as string in options: #{ options [ :json ] . class } "
20
+ end
18
21
19
22
@catalog_json = options . fetch ( :json )
20
23
begin
Original file line number Diff line number Diff line change @@ -17,14 +17,9 @@ class PuppetDB < OctocatalogDiff::Catalog
17
17
def initialize ( options )
18
18
super
19
19
20
- raise ArgumentError , 'node must be a non-empty string' unless options [ :node ] . is_a? ( String ) && options [ :node ] != ''
21
- @node = options [ :node ]
22
- @catalog = nil
23
- @error_message = nil
24
- @retries = nil
25
-
26
- # Save options
27
- @options = options
20
+ unless @options [ :node ] . is_a? ( String ) && @options [ :node ] != ''
21
+ raise ArgumentError , 'node must be a non-empty string'
22
+ end
28
23
end
29
24
30
25
private
Original file line number Diff line number Diff line change @@ -34,20 +34,21 @@ class PuppetMaster < OctocatalogDiff::Catalog
34
34
def initialize ( options )
35
35
super
36
36
37
- raise ArgumentError , 'node must be a non-empty string' unless options [ :node ] . is_a? ( String ) && options [ :node ] != ''
38
- unless options [ :branch ] . is_a? ( String ) && options [ :branch ] != ''
37
+ unless @options [ :node ] . is_a? ( String ) && @options [ :node ] != ''
38
+ raise ArgumentError , 'node must be a non-empty string'
39
+ end
40
+
41
+ unless @options [ :branch ] . is_a? ( String ) && @options [ :branch ] != ''
39
42
raise ArgumentError , 'Environment must be a non-empty string'
40
43
end
41
- unless options [ :puppet_master ] . is_a? ( String ) && options [ :puppet_master ] != ''
44
+
45
+ unless @options [ :puppet_master ] . is_a? ( String ) && @options [ :puppet_master ] != ''
42
46
raise ArgumentError , 'Puppet Master must be a non-empty string'
43
47
end
44
48
45
- @retries = nil
46
49
@timeout = options . fetch ( :puppet_master_timeout , options . fetch ( :timeout , PUPPET_MASTER_TIMEOUT ) )
47
50
@retry_failed_catalog = options . fetch ( :retry_failed_catalog , 0 )
48
-
49
- options [ :puppet_master ] += ":#{ DEFAULT_PUPPET_PORT_NUMBER } " unless options [ :puppet_master ] =~ /\: \d +$/
50
- @options = options
51
+ @options [ :puppet_master ] += ":#{ DEFAULT_PUPPET_PORT_NUMBER } " unless @options [ :puppet_master ] =~ /\: \d +$/
51
52
end
52
53
53
54
private
You can’t perform that action at this time.
0 commit comments