@@ -629,7 +629,7 @@ def generate_oar_properties(options)
629
629
630
630
if missings_alive . size > 0
631
631
puts "*** Error: The following nodes exist in the OAR server but are missing in the reference-repo: #{ missings_alive . join ( ', ' ) } .\n "
632
- ret = false unless options [ :exec ] || options [ :output ]
632
+ ret = false unless options [ :update ] || options [ :print ]
633
633
end
634
634
635
635
skipped_nodes = [ ]
@@ -684,7 +684,7 @@ def generate_oar_properties(options)
684
684
puts JSON . pretty_generate ( key => { 'old values' => properties_oar , 'new values' => properties_ref } )
685
685
end
686
686
if diff . size != 0
687
- ret = false unless options [ :exec ] || options [ :output ]
687
+ ret = false unless options [ :update ] || options [ :print ]
688
688
end
689
689
end
690
690
end
@@ -700,7 +700,7 @@ def generate_oar_properties(options)
700
700
if v_oar && v_oar != v_ref && v_ref != NilClass && v_oar != NilClass
701
701
# Detect inconsistency between the type (String/Fixnum) of properties generated by this script and the existing values on the server.
702
702
puts "Error: the OAR property '#{ k } ' is a '#{ v_oar } ' on the #{ site_uid } server and this script uses '#{ v_ref } ' for this property."
703
- ret = false unless options [ :exec ] || options [ :output ]
703
+ ret = false unless options [ :update ] || options [ :print ]
704
704
end
705
705
end
706
706
@@ -715,19 +715,19 @@ def generate_oar_properties(options)
715
715
if options [ :verbose ] && unknown_properties . size > 0
716
716
puts "Properties existing on the #{ site_uid } server but not managed/known by the generator: #{ unknown_properties . to_a . join ( ', ' ) } ."
717
717
puts "Hint: you can delete properties with 'oarproperty -d <property>' or add them to the ignore list in lib/lib-oar-properties.rb."
718
- ret = false unless options [ :exec ] || options [ :output ]
718
+ ret = false unless options [ :update ] || options [ :print ]
719
719
end
720
720
puts "Skipped retired nodes: #{ skipped_nodes } " if skipped_nodes . any?
721
721
end # if options[:diff]
722
722
end
723
723
724
724
# Build and execute commands
725
- if options [ :output ] || options [ :exec ]
725
+ if options [ :print ] || options [ :update ]
726
726
skipped_nodes = [ ] unless options [ :diff ]
727
727
opt = options [ :diff ] ? 'diff' : 'ref'
728
728
729
729
properties [ opt ] . each do |site_uid , site_properties |
730
- options [ :output ] . is_a? ( String ) ? o = File . open ( options [ :output ] . gsub ( '%s' , site_uid ) , 'w' ) : o = $stdout. dup
730
+ options [ :print ] . is_a? ( String ) ? o = File . open ( options [ :print ] . gsub ( '%s' , site_uid ) , 'w' ) : o = $stdout. dup
731
731
732
732
ssh_cmd = [ ]
733
733
cmd = [ ]
@@ -767,8 +767,8 @@ def generate_oar_properties(options)
767
767
cmd << oarcmd_set_node_properties ( node_address , node_properties )
768
768
cmd << oarcmd_separator
769
769
end
770
- ssh_cmd += cmd if options [ :exec ]
771
- o . write ( cmd . join ( '' ) ) if options [ :output ]
770
+ ssh_cmd += cmd if options [ :update ]
771
+ o . write ( cmd . join ( '' ) ) if options [ :print ]
772
772
cmd = [ ]
773
773
end
774
774
@@ -792,14 +792,14 @@ def generate_oar_properties(options)
792
792
cmd << oarcmd_separator
793
793
end
794
794
795
- ssh_cmd += cmd if options [ :exec ]
796
- o . write ( cmd . join ( '' ) ) if options [ :output ]
795
+ ssh_cmd += cmd if options [ :update ]
796
+ o . write ( cmd . join ( '' ) ) if options [ :print ]
797
797
cmd = [ ]
798
798
end
799
799
o . close
800
800
801
801
# Execute commands
802
- if options [ :exec ]
802
+ if options [ :update ]
803
803
printf 'Apply changes to the OAR server ' + options [ :ssh ] [ :host ] . gsub ( '%s' , site_uid ) + ' ? (y/N) '
804
804
prompt = STDIN . gets . chomp
805
805
ssh_exec ( ssh_cmd , options , site_uid ) if prompt . downcase == 'y'
@@ -809,7 +809,7 @@ def generate_oar_properties(options)
809
809
if skipped_nodes . any?
810
810
puts "Skipped retired nodes: #{ skipped_nodes } " unless options [ :diff ]
811
811
end
812
- end # if options[:output ] || options[:exec ]
812
+ end # if options[:print ] || options[:update ]
813
813
814
814
return ret
815
815
end
0 commit comments