File tree Expand file tree Collapse file tree 5 files changed +3
-52
lines changed Expand file tree Collapse file tree 5 files changed +3
-52
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,9 @@ def sync
223223    newparam ( :path )  do 
224224      desc  "The search path used for command execution. 
225225        Commands must be fully qualified if no path is specified.  Paths 
226-         can be specified as an array or as a '#{ File ::PATH_SEPARATOR }  ' separated list." 
226+         can be specified as an array or as a '#{ File ::PATH_SEPARATOR }  ' separated list. Defaults to the `path` fact." 
227+ 
228+       defaultto  Puppet . runtime [ :facter ] . value ( 'path' ) 
227229
228230      # Support both arrays and colon-separated fields. 
229231      def  value = ( *values ) 
Original file line number Diff line number Diff line change @@ -649,31 +649,6 @@ def with_another_agent_running(&block)
649649       ) ) . to_stdout 
650650       . and  output ( /No more routes to fileserver/ ) . to_stderr 
651651    end 
652- 
653-     it  'preserves the old cached catalog if validation fails with the old one'  do 
654-       catalog_handler  =  ->  ( req ,  res )  { 
655-         catalog  =  compile_to_catalog ( <<-MANIFEST ,  node ) 
656-           exec { 'unqualified_command': } 
657-         MANIFEST 
658- 
659-         res . body  =  formatter . render ( catalog ) 
660-         res [ 'Content-Type' ]  =  formatter . mime 
661-       } 
662- 
663-       server . start_server ( mounts : { catalog : catalog_handler } )  do  |port |
664-         Puppet [ :serverport ]  =  port 
665-         expect  { 
666-           agent . command_line . args  << '--test' 
667-           agent . run 
668-         } . to  exit_with ( 1 ) 
669-          . and  output ( %r{Retrieving plugin} ) . to_stdout 
670-          . and  output ( %r{Validation of Exec\[ unqualified_command\]  failed: 'unqualified_command' is not qualified and no path was specified} ) . to_stderr 
671-       end 
672- 
673-       # cached catalog should not be updated 
674-       cached_catalog  =  "#{ File . join ( Puppet [ :client_datadir ] ,  'catalog' ,  Puppet [ :certname ] ) }  .json" 
675-       expect ( File ) . to_not  be_exist ( cached_catalog ) 
676-     end 
677652  end 
678653
679654  context  "reporting"  do 
Original file line number Diff line number Diff line change @@ -15,13 +15,6 @@ def make_exe
1515  let ( :provider )  {  described_class . new ( resource )  } 
1616
1717  describe  "#validatecmd"  do 
18-     it  "should fail if no path is specified and the command is not fully qualified"  do 
19-       expect  {  provider . validatecmd ( "foo" )  } . to  raise_error ( 
20-         Puppet ::Error , 
21-         "'foo' is not qualified and no path was specified. Please qualify the command or specify a path." 
22-       ) 
23-     end 
24- 
2518    it  "should pass if a path is given"  do 
2619      provider . resource [ :path ]  =  [ '/bogus/bin' ] 
2720      provider . validatecmd ( "../foo" ) 
Original file line number Diff line number Diff line change @@ -73,20 +73,6 @@ def echo_from_ruby_exit_1(message)
7373    end 
7474
7575    context  "when validating the command"  do 
76-       it  "redacts the arguments if the command is relative"  do 
77-         expect  { 
78-           apply_compiled_manifest ( <<-MANIFEST ) 
79-             exec { 'echo': 
80-               command => Sensitive.new('echo #{ supersecret }  ') 
81-             } 
82-           MANIFEST 
83-         } . to  raise_error  do  |err |
84-           expect ( err ) . to  be_a ( Puppet ::Error ) 
85-           expect ( err . message ) . to  match ( /'echo' is not qualified and no path was specified. Please qualify the command or specify a path./ ) 
86-           expect ( err . message ) . to_not  match ( /#{ supersecret }  / ) 
87-         end 
88-       end 
89- 
9076      it  "redacts the arguments if the command is a directory"  do 
9177        dir  =  tmpdir ( 'exec' ) 
9278        apply_compiled_manifest ( <<-MANIFEST ) 
Original file line number Diff line number Diff line change @@ -910,11 +910,6 @@ def instance(path)
910910    let  :abs   do  make_absolute ( '/bin/echo' )  end 
911911    let  :path  do  make_absolute ( '/bin' )  end 
912912
913-     it  "should fail with relative command and no path"  do 
914-       expect  {  type . new ( :command  =>  rel )  } . 
915-         to  raise_error  Puppet ::Error ,  /no path was specified/ 
916-     end 
917- 
918913    it  "should accept a relative command with a path"  do 
919914      expect ( type . new ( :command  =>  rel ,  :path  =>  path ) ) . to  be 
920915    end 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments